Core/Unit: Force cancel unit events before invalidating the object on destruction

* Closes #16675

(cherry picked from commit 0c97ef5f74)
This commit is contained in:
Naios
2016-08-27 11:29:58 +02:00
parent cf63094e9f
commit cc51ae6f9a

View File

@@ -314,9 +314,11 @@ Unit::~Unit()
if (m_currentSpells[i])
{
m_currentSpells[i]->SetReferencedFromCurrent(false);
m_currentSpells[i] = NULL;
m_currentSpells[i] = nullptr;
}
m_Events.KillAllEvents(true);
_DeleteRemovedAuras();
delete i_motionMaster;