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:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user