Remove crash on mangos from not unloaded objects on unload

This commit is contained in:
Rochet2
2014-09-15 09:48:30 +03:00
parent 9db50e4772
commit f11d1767c1

View File

@@ -51,9 +51,11 @@ ElunaEventProcessor::~ElunaEventProcessor()
RemoveEvents();
// In multithread get the object's map's lua state
Eluna* E = obj ? sEluna : sEluna;
EventMgr::WriteGuard lock(E->eventMgr->GetLock());
E->eventMgr->processors.erase(this);
if (Eluna* E = obj ? sEluna : sEluna)
{
EventMgr::WriteGuard lock(E->eventMgr->GetLock());
E->eventMgr->processors.erase(this);
}
}
void ElunaEventProcessor::Update(uint32 diff)