From d398b559d7487822e56d62cb2c0197b772e9b35b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 Jun 2018 10:25:08 -0400 Subject: Automatically finish reader on destruction --- serd/serd.h | 5 +++++ src/reader.c | 1 + 2 files changed, 6 insertions(+) diff --git a/serd/serd.h b/serd/serd.h index 7ad4d36b..7571c82b 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -1169,6 +1169,9 @@ serd_reader_read_document(SerdReader* reader); /** Finish reading from the source. + + This will close the open file, if applicable, and ensure the reader has + processed all input. */ SERD_API SerdStatus @@ -1176,6 +1179,8 @@ serd_reader_finish(SerdReader* reader); /** Free `reader`. + + The reader will be finished via `serd_reader_finish()` if necessary. */ SERD_API void diff --git a/src/reader.c b/src/reader.c index 1bbb17dc..065e1c51 100644 --- a/src/reader.c +++ b/src/reader.c @@ -193,6 +193,7 @@ serd_reader_set_strict(SerdReader* reader, bool strict) void serd_reader_free(SerdReader* reader) { + serd_reader_finish(reader); serd_node_free(reader->default_graph); #ifdef SERD_STACK_CHECK -- cgit v1.2.1