]> wimlib.net Git - wimlib/blobdiff - src/wim.c
read_compressed_resource(): Fix use of decompressor
[wimlib] / src / wim.c
index 97e156ddd40d23616a9bfca2e59cd4dd8961bdb7..d833ec75b53cd66dc16055e21604497636fd4609 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -38,6 +38,8 @@
 #include "wimlib/security.h"
 #include "wimlib/wim.h"
 #include "wimlib/xml.h"
+#include "wimlib/compressor_ops.h"
+#include "wimlib/decompressor_ops.h"
 
 #ifdef __WIN32__
 #  include "wimlib/win32.h" /* for realpath() replacement */
@@ -937,10 +939,10 @@ wimlib_free(WIMStruct *wim)
        if (filedes_valid(&wim->out_fd))
                filedes_close(&wim->out_fd);
 
-       wimlib_lzx_free_context(wim->lzx_context);
-
        free_lookup_table(wim->lookup_table);
 
+       wimlib_free_decompressor(wim->decompressor);
+
        FREE(wim->filename);
        free_wim_info(wim->wim_info);
        if (wim->image_metadata) {
@@ -1003,4 +1005,6 @@ wimlib_global_cleanup(void)
 #ifdef __WIN32__
        win32_global_cleanup();
 #endif
+       cleanup_decompressor_params();
+       cleanup_compressor_params();
 }