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
2010-06-21 23:20:58 +02:00
parent 5c86cc2aee
commit 95ddfbd9e2
19 changed files with 47 additions and 94 deletions
@@ -387,8 +387,7 @@ AuraEffect::AuraEffect(Aura * base, uint8 effIndex, int32 *baseAmount, Unit * ca
AuraEffect::~AuraEffect()
{
if (m_spellmod)
delete m_spellmod;
delete m_spellmod;
}
void AuraEffect::GetTargetList(std::list<Unit *> & targetList) const
+1 -2
View File
@@ -342,8 +342,7 @@ Aura::~Aura()
{
// free effects memory
for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i)
if (m_effects[i])
delete m_effects[i];
delete m_effects[i];
assert(m_applications.empty());
_DeleteRemovedApplications();