mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2026-01-25 08:42:36 +01:00
fix: memory leak in sprite model
This commit is contained in:
committed by
EricS-Valve
parent
ec89b70ea3
commit
87bca061fb
@@ -269,7 +269,7 @@ bool CEngineSprite::Init( const char *pName )
|
||||
Q_strncpy( pMaterialPath, pMaterialName, sizeof(pMaterialPath) );
|
||||
Q_SetExtension( pMaterialPath, ".vmt", sizeof(pMaterialPath) );
|
||||
|
||||
KeyValues *kv = new KeyValues( "vmt" );
|
||||
KeyValuesAD kv( "vmt" );
|
||||
if ( !kv->LoadFromFile( g_pFullFileSystem, pMaterialPath, "GAME" ) )
|
||||
{
|
||||
Warning( "Unable to load sprite material %s!\n", pMaterialPath );
|
||||
@@ -291,8 +291,6 @@ bool CEngineSprite::Init( const char *pName )
|
||||
m_material[ i ]->IncrementReferenceCount();
|
||||
}
|
||||
|
||||
kv->deleteThis();
|
||||
|
||||
m_width = m_material[0]->GetMappingWidth();
|
||||
m_height = m_material[0]->GetMappingHeight();
|
||||
m_numFrames = m_material[0]->GetNumAnimationFrames();
|
||||
|
||||
Reference in New Issue
Block a user