diff options
author | QAston <none@none> | 2010-01-19 21:33:35 +0100 |
---|---|---|
committer | QAston <none@none> | 2010-01-19 21:33:35 +0100 |
commit | 7ef6842cf3a005dcb0c9dca66ad4cb252a2368e4 (patch) | |
tree | 115380540d87f6412397d93e39d2646777565fa7 /src | |
parent | 41bff63fe7012820e1fb9365a99a4540a0ef3cde (diff) |
*Fix a memory leak with auras for cases when there are some spells casted on unit during remove from world - all thanks go to debug assert fails, which you all love so much.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e8955a18124..fbd3444bd5d 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12964,6 +12964,9 @@ void Unit::RemoveFromWorld() void Unit::CleanupsBeforeDelete() { + if (IsInWorld()) + RemoveFromWorld(); + assert(GetGUID()); //A unit may be in removelist and not in world, but it is still in grid @@ -12977,9 +12980,6 @@ void Unit::CleanupsBeforeDelete() DeleteThreatList(); getHostilRefManager().setOnlineOfflineState(false); GetMotionMaster()->Clear(false); // remove different non-standard movement generators. - - if (IsInWorld()) - RemoveFromWorld(); } void Unit::UpdateCharmAI() |