Add nullptr check for kv delete operator
This commit is contained in:
parent
2dd20478e4
commit
d2f945c87f
1 changed files with 8 additions and 2 deletions
|
@ -2805,14 +2805,20 @@ void *KeyValues::operator new( size_t iAllocSize, int nBlockUse, const char *pFi
|
|||
// Purpose: deallocator
|
||||
//-----------------------------------------------------------------------------
|
||||
void KeyValues::operator delete( void *pMem )
|
||||
{
|
||||
if (pMem)
|
||||
{
|
||||
KeyValuesSystem()->FreeKeyValuesMemory(pMem);
|
||||
}
|
||||
}
|
||||
|
||||
void KeyValues::operator delete( void *pMem, int nBlockUse, const char *pFileName, int nLine )
|
||||
{
|
||||
if (pMem)
|
||||
{
|
||||
KeyValuesSystem()->FreeKeyValuesMemory(pMem);
|
||||
}
|
||||
}
|
||||
|
||||
void KeyValues::UnpackIntoStructure( KeyValuesUnpackStructure const *pUnpackTable, void *pDest, size_t DestSizeInBytes )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue