]> wimlib.net Git - wimlib/blobdiff - src/wim.c
Add wimlib_global_{init,cleanup}()
[wimlib] / src / wim.c
index 23858d69b03c538261c64fee25e0db49030442f6..b52a28d99c265cbf79b0ff1de3642dd9216eadc0 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -634,3 +634,19 @@ WIMLIBAPI void wimlib_free(WIMStruct *w)
 #endif
        FREE(w);
 }
 #endif
        FREE(w);
 }
+
+/* Get global memory allocations out of the way.  Not strictly necessary in
+ * single-threaded programs like 'imagex'. */
+WIMLIBAPI int wimlib_global_init()
+{
+       libxml_global_init();
+       return iconv_global_init();
+}
+
+/* Free global memory allocations.  Not strictly necessary if the process using
+ * wimlib is just about to exit (as is the case for 'imagex'). */
+WIMLIBAPI void wimlib_global_cleanup()
+{
+       libxml_global_cleanup();
+       iconv_global_cleanup();
+}