diff options
Diffstat (limited to 'src/game/ObjectAccessor.h')
-rw-r--r-- | src/game/ObjectAccessor.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index 67ef5efef89..79afa78fb6a 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -52,7 +52,11 @@ class HashMapHolder typedef ACE_Thread_Mutex LockType; typedef MaNGOS::GeneralLock<LockType > Guard; - static void Insert(T* o) { m_objectMap[o->GetGUID()] = o; } + static void Insert(T* o) + { + Guard guard(i_lock); + m_objectMap[o->GetGUID()] = o; + } static void Remove(T* o) { @@ -62,6 +66,7 @@ class HashMapHolder static T* Find(uint64 guid) { + Guard guard(i_lock); typename MapType::iterator itr = m_objectMap.find(guid); return (itr != m_objectMap.end()) ? itr->second : NULL; } |