diff --git a/Source/clzma.cpp b/Source/clzma.cpp index 44bea1f9..a4bfa94b 100644 --- a/Source/clzma.cpp +++ b/Source/clzma.cpp @@ -133,15 +133,23 @@ CLZMA::CLZMA(): _encoder(NULL) hCompressionThread = 0; SetNextOut(NULL, 0); SetNextIn(NULL, 0); + + AddRef(); // will be manually deleted, not released } CLZMA::~CLZMA() { End(); if (hNeedIOEvent) + { CloseHandle(hNeedIOEvent); + hNeedIOEvent = NULL; + } if (hIOReadyEvent) + { CloseHandle(hIOReadyEvent); + hIOReadyEvent = NULL; + } if (_encoder) { delete _encoder;