X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwim.c;h=b52a28d99c265cbf79b0ff1de3642dd9216eadc0;hp=23858d69b03c538261c64fee25e0db49030442f6;hb=7bde3fc590afbdef8f71cd7f8ccbd24172bffc63;hpb=b78b15e68de3c3f9a6aed5d3514e86a72cc9c9b1 diff --git a/src/wim.c b/src/wim.c index 23858d69..b52a28d9 100644 --- a/src/wim.c +++ b/src/wim.c @@ -634,3 +634,19 @@ WIMLIBAPI void wimlib_free(WIMStruct *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(); +}