* 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:
kichik 2006-03-08 16:14:36 +00:00
parent 015723663b
commit 502f3c67da

View file

@ -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;