summaryrefslogtreecommitdiffstats
path: root/src/plist.c
diff options
context:
space:
mode:
authorGravatar Frederik Carlier2016-03-26 15:30:28 +0100
committerGravatar Nikias Bassen2016-04-20 14:18:46 +0200
commit6ab7e301f1854fd18891ddfeaa64e7485be990ba (patch)
treeb895af9cd1f73235f85bc1b67d450e2fbd590d6e /src/plist.c
parent275cfcd5ac317185c9f3d8156c357df5f8155c37 (diff)
downloadlibplist-6ab7e301f1854fd18891ddfeaa64e7485be990ba.tar.gz
libplist-6ab7e301f1854fd18891ddfeaa64e7485be990ba.tar.bz2
Move libxml cleanup code to a plist_cleanup method
Diffstat (limited to 'src/plist.c')
-rw-r--r--src/plist.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plist.c b/src/plist.c
index d40b946..569251b 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -31,6 +31,24 @@
#include <node.h>
#include <node_iterator.h>
+#include <libxml/encoding.h>
+#include <libxml/dict.h>
+#include <libxml/xmlerror.h>
+#include <libxml/globals.h>
+#include <libxml/threads.h>
+#include <libxml/xmlmemory.h>
+
+void plist_cleanup(void)
+{
+ /* free memory from parser initialization */
+ xmlCleanupCharEncodingHandlers();
+ xmlDictCleanup();
+ xmlResetLastError();
+ xmlCleanupGlobals();
+ xmlCleanupThreads();
+ xmlCleanupMemory();
+}
+
plist_t plist_new_node(plist_data_t data)
{
return (plist_t) node_create(NULL, data);