Skip to content

Commit 836a537

Browse files
committed
actually fix KV crash in game rules
1 parent c6c5e4c commit 836a537

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

game/shared/tf/tf_gamerules.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18000,16 +18000,16 @@ const char *CTFGameRules::GetTeamGoalString( int iTeam )
1800018000

1800118001
CTFGameRules::~CTFGameRules()
1800218002
{
18003-
if ( m_pkvVisionFilterTranslations )
18003+
if (m_pkvVisionFilterTranslationsParticle)
1800418004
{
18005-
m_pkvVisionFilterTranslations->deleteThis();
18006-
m_pkvVisionFilterTranslations = NULL;
18005+
// We don't delete, because it's deleted in the parent below.
18006+
m_pkvVisionFilterTranslationsParticle = NULL;
1800718007
}
1800818008

18009-
if (m_pkvVisionFilterTranslationsParticle)
18009+
if ( m_pkvVisionFilterTranslations )
1801018010
{
18011-
m_pkvVisionFilterTranslationsParticle->deleteThis();
18012-
m_pkvVisionFilterTranslationsParticle = NULL;
18011+
m_pkvVisionFilterTranslations->deleteThis();
18012+
m_pkvVisionFilterTranslations = NULL;
1801318013
}
1801418014

1801518015
if ( m_pkvVisionFilterShadersMapWhitelist )

tier1/KeyValues.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2807,18 +2807,12 @@ void *KeyValues::operator new( size_t iAllocSize, int nBlockUse, const char *pFi
28072807
//-----------------------------------------------------------------------------
28082808
void KeyValues::operator delete( void *pMem )
28092809
{
2810-
if (pMem)
2811-
{
2812-
KeyValuesSystem()->FreeKeyValuesMemory(pMem);
2813-
}
2810+
KeyValuesSystem()->FreeKeyValuesMemory(pMem);
28142811
}
28152812

28162813
void KeyValues::operator delete( void *pMem, int nBlockUse, const char *pFileName, int nLine )
28172814
{
2818-
if (pMem)
2819-
{
2820-
KeyValuesSystem()->FreeKeyValuesMemory(pMem);
2821-
}
2815+
KeyValuesSystem()->FreeKeyValuesMemory(pMem);
28222816
}
28232817

28242818
void KeyValues::UnpackIntoStructure( KeyValuesUnpackStructure const *pUnpackTable, void *pDest, size_t DestSizeInBytes )

0 commit comments

Comments
 (0)