From 4fb9309882df6c4b6d2a554b91e02b4be9dab0dd Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 22 Sep 2005 20:20:11 +0000 Subject: [PATCH] fixed memory leaks in POSIX implementation git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4281 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/clzma.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/clzma.cpp b/Source/clzma.cpp index 295023b4..44bea1f9 100644 --- a/Source/clzma.cpp +++ b/Source/clzma.cpp @@ -23,6 +23,7 @@ HANDLE CreateEvent(void *, BOOL, BOOL, char *) } if (pthread_mutex_init(&event->mutex, NULL)) { + pthread_cond_destroy(&event->cond); free(event); return 0; } @@ -205,15 +206,16 @@ int CLZMA::End() pthread_join(hCompressionThread, NULL); #endif } -#ifdef _WIN32 if (hCompressionThread) { +#ifdef _WIN32 CloseHandle(hCompressionThread); hCompressionThread = NULL; - } #else - hCompressionThread = 0; + pthread_detach(hCompressionThread); + hCompressionThread = 0; #endif + } SetNextOut(NULL, 0); SetNextIn(NULL, 0); return C_OK;