* never delete self on Release(), CLZMA is not a real COM class
* safer destructor git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4557 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
015723663b
commit
502f3c67da
1 changed files with 8 additions and 0 deletions
|
@ -133,15 +133,23 @@ CLZMA::CLZMA(): _encoder(NULL)
|
||||||
hCompressionThread = 0;
|
hCompressionThread = 0;
|
||||||
SetNextOut(NULL, 0);
|
SetNextOut(NULL, 0);
|
||||||
SetNextIn(NULL, 0);
|
SetNextIn(NULL, 0);
|
||||||
|
|
||||||
|
AddRef(); // will be manually deleted, not released
|
||||||
}
|
}
|
||||||
|
|
||||||
CLZMA::~CLZMA()
|
CLZMA::~CLZMA()
|
||||||
{
|
{
|
||||||
End();
|
End();
|
||||||
if (hNeedIOEvent)
|
if (hNeedIOEvent)
|
||||||
|
{
|
||||||
CloseHandle(hNeedIOEvent);
|
CloseHandle(hNeedIOEvent);
|
||||||
|
hNeedIOEvent = NULL;
|
||||||
|
}
|
||||||
if (hIOReadyEvent)
|
if (hIOReadyEvent)
|
||||||
|
{
|
||||||
CloseHandle(hIOReadyEvent);
|
CloseHandle(hIOReadyEvent);
|
||||||
|
hIOReadyEvent = NULL;
|
||||||
|
}
|
||||||
if (_encoder)
|
if (_encoder)
|
||||||
{
|
{
|
||||||
delete _encoder;
|
delete _encoder;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue