*Lock on RemoveAllAuras till all auras and applications are removed with all linked events they may cause.

*Add assertion after error log, just in case you've missed it.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-30 03:07:34 +02:00
parent cad437d7f0
commit 272e954a70
2 changed files with 13 additions and 8 deletions
+5 -1
View File
@@ -4412,6 +4412,10 @@ void Unit::RemoveAreaAurasDueToLeaveWorld()
void Unit::RemoveAllAuras()
{
// this may be a dead loop if some events on aura remove will continiously apply aura on remove
// we want to have all auras removed, so use your brain when linking events
while (!m_appliedAuras.empty() || !m_ownedAuras.empty())
{
AuraApplicationMap::iterator aurAppIter;
for (aurAppIter = m_appliedAuras.begin(); aurAppIter != m_appliedAuras.end();)
_UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT);
@@ -4419,7 +4423,7 @@ void Unit::RemoveAllAuras()
AuraMap::iterator aurIter;
for (aurIter = m_ownedAuras.begin(); aurIter != m_ownedAuras.end();)
RemoveOwnedAura(aurIter);
}
}
void Unit::RemoveArenaAuras(bool onleave)
+1
View File
@@ -6631,6 +6631,7 @@ SpellEvent::~SpellEvent()
{
sLog.outError("~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
(m_Spell->GetCaster()->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), m_Spell->GetCaster()->GetGUIDLow(), m_Spell->m_spellInfo->Id);
ASSERT(false);
}
}