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:
Machiavelli committed 2010-06-21 23:20:58 +02:00
1 parent 5c86cc2aee
commit 95ddfbd9e2
19 files changed
+47 -94

No files matched your search

+3 -6
View File
@@ -201,10 +201,8 @@ Unit::~Unit()
RemoveAllDynObjects();
_DeleteRemovedAuras();
if (m_charmInfo)
delete m_charmInfo;
if (m_vehicleKit)
delete m_vehicleKit;
delete m_charmInfo;
delete m_vehicleKit;
assert(!m_attacking);
assert(m_attackers.empty());
@@ -13297,8 +13295,7 @@ void Unit::UpdateCharmAI()
{
if (!isCharmed())
{
if (i_AI)
delete i_AI;
delete i_AI;
i_AI = i_disabledAI;
i_disabledAI = NULL;
}