Remove some redundant explicit NULL checks for pointers before ´delete´ or ´delete[]´ calls since this check is done implicitly when deleting.
Also fixes a memory leak in .reload creature_template command --HG-- branch : trunk
This commit is contained in:
@@ -113,13 +113,9 @@ Object::~Object()
|
||||
ObjectAccessor::Instance().RemoveUpdateObject(this);
|
||||
}
|
||||
|
||||
if (m_uint32Values)
|
||||
{
|
||||
//DEBUG_LOG("Object desctr 1 check (%p)",(void*)this);
|
||||
delete [] m_uint32Values;
|
||||
delete [] m_uint32Values_mirror;
|
||||
//DEBUG_LOG("Object desctr 2 check (%p)",(void*)this);
|
||||
}
|
||||
delete [] m_uint32Values;
|
||||
delete [] m_uint32Values_mirror;
|
||||
|
||||
}
|
||||
|
||||
void Object::_InitValues()
|
||||
|
||||
@@ -32,8 +32,7 @@ class UpdateMask
|
||||
|
||||
~UpdateMask()
|
||||
{
|
||||
if (mUpdateMask)
|
||||
delete [] mUpdateMask;
|
||||
delete [] mUpdateMask;
|
||||
}
|
||||
|
||||
void SetBit (uint32 index)
|
||||
@@ -58,8 +57,7 @@ class UpdateMask
|
||||
|
||||
void SetCount (uint32 valuesCount)
|
||||
{
|
||||
if (mUpdateMask)
|
||||
delete [] mUpdateMask;
|
||||
delete [] mUpdateMask;
|
||||
|
||||
mCount = valuesCount;
|
||||
mBlocks = (valuesCount + 31) / 32;
|
||||
|
||||
Reference in New Issue
Block a user