summaryrefslogtreecommitdiff
path: root/include/nslog/nslog.h
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-09-10 14:11:50 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-09-10 14:11:50 +0100
commite7e71a94cdf413ca27cf77729867c940db589353 (patch)
tree760f07dca5e7a960b75225400481eb01c5333a72 /include/nslog/nslog.h
parentfbebd45ac3204addce4240df475b9565f47df492 (diff)
downloadlibnslog-e7e71a94cdf413ca27cf77729867c940db589353.tar.gz
libnslog-e7e71a94cdf413ca27cf77729867c940db589353.tar.bz2
Add cleanup to nslog
Diffstat (limited to 'include/nslog/nslog.h')
-rw-r--r--include/nslog/nslog.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/nslog/nslog.h b/include/nslog/nslog.h
index 0288f5d..9113527 100644
--- a/include/nslog/nslog.h
+++ b/include/nslog/nslog.h
@@ -258,6 +258,24 @@ nslog_error nslog_set_render_callback(nslog_callback cb, void *context);
nslog_error nslog_uncork(void);
/**
+ * Finalise log categories, release filter handles, etc.
+ *
+ * Since logging categories can have memory allocated to them at runtime,
+ * and the logging filters can have references held inside the library,
+ * clients which wish to be 'valgrind clean' may wish to call this to
+ * ensure that any memory allocated inside the nslog library is released.
+ *
+ * This does not remove the active log callback, so logging calls after this
+ * returns will still work (though will be unfiltered). Of course, they will
+ * cause memory to be allocated once more. This function can be called as
+ * many times as desired, it is idempotent.
+ *
+ * If the logging was corked when this was called, pending corked messages
+ * will be delivered if necessary before any filters are removed.
+ */
+void nslog_cleanup(void);
+
+/**
* Log filter handle
*
* nslog allows clients to set a complex filter which can be used to restrict