xz: Call lzma_end(&strm) before exiting if debugging is enabled.

This commit is contained in:
Lasse Collin 2011-04-05 15:13:29 +03:00
parent bd432015d3
commit 1ef3cf44a8
3 changed files with 19 additions and 0 deletions

View File

@ -698,3 +698,13 @@ coder_run(const char *filename)
return; return;
} }
#ifndef NDEBUG
extern void
coder_free(void)
{
lzma_end(&strm);
return;
}
#endif

View File

@ -65,3 +65,8 @@ extern void coder_set_compression_settings(void);
/// Compress or decompress the given file /// Compress or decompress the given file
extern void coder_run(const char *filename); extern void coder_run(const char *filename);
#ifndef NDEBUG
/// Free the memory allocated for the coder and kill the worker threads.
extern void coder_free(void);
#endif

View File

@ -275,6 +275,10 @@ main(int argc, char **argv)
list_totals(); list_totals();
} }
#ifndef NDEBUG
coder_free();
#endif
// If we have got a signal, raise it to kill the program instead // If we have got a signal, raise it to kill the program instead
// of calling tuklib_exit(). // of calling tuklib_exit().
signals_exit(); signals_exit();