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
This commit is contained in:
parent
64bdfbd620
commit
4fb9309882
1 changed files with 5 additions and 3 deletions
|
@ -23,6 +23,7 @@ HANDLE CreateEvent(void *, BOOL, BOOL, char *)
|
||||||
}
|
}
|
||||||
if (pthread_mutex_init(&event->mutex, NULL))
|
if (pthread_mutex_init(&event->mutex, NULL))
|
||||||
{
|
{
|
||||||
|
pthread_cond_destroy(&event->cond);
|
||||||
free(event);
|
free(event);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -205,15 +206,16 @@ int CLZMA::End()
|
||||||
pthread_join(hCompressionThread, NULL);
|
pthread_join(hCompressionThread, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
|
||||||
if (hCompressionThread)
|
if (hCompressionThread)
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
CloseHandle(hCompressionThread);
|
CloseHandle(hCompressionThread);
|
||||||
hCompressionThread = NULL;
|
hCompressionThread = NULL;
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
hCompressionThread = 0;
|
pthread_detach(hCompressionThread);
|
||||||
|
hCompressionThread = 0;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
SetNextOut(NULL, 0);
|
SetNextOut(NULL, 0);
|
||||||
SetNextIn(NULL, 0);
|
SetNextIn(NULL, 0);
|
||||||
return C_OK;
|
return C_OK;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue