aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--serd/serd.h5
-rw-r--r--src/reader.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h
index d518aaba..4a1ccd0d 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -1137,6 +1137,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
@@ -1144,6 +1147,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 c38bf279..38b8a8b0 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -190,6 +190,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