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:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user