Major memory leak fix regarding packages.

The reason that only some people were experiencing a major memory leak
was that it had to do with packages, a lot of devs don't use packages.

This leak could not be found through conventional methods, as zlib's ram
seems to be allocated from the global ram.
This commit is contained in:
Charles Lohr
2004-12-09 02:09:32 +00:00
parent 0292eb99c1
commit 9a93860c6a
+7 -2
View File
@@ -502,9 +502,14 @@ RageFileObjZipDeflated::RageFileObjZipDeflated( const RageFileObjZipDeflated &cp
RageFileObjZipDeflated::~RageFileObjZipDeflated()
{
int err = inflateReset( &dstrm );
//We MUST use inflateEnd() here insted of inflateReset(). Use
//of inflateReset() will cause large quantities of globally
//allocated ram to be leaked, making it impervious to most leak
//detection. See zlib.h documentation on inflateReset() for
//more information.
int err = inflateEnd( &dstrm );
if( err != Z_OK )
LOG->Trace( "Huh? inflateReset() err = %i", err );
LOG->Trace( "Huh? inflateEnd() err = %i", err );
}
int RageFileObjZipDeflated::Read( void *buf, size_t bytes )