diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 21 | ||||
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 4 | ||||
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 4 |
3 files changed, 27 insertions, 2 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index fe2a89de9aa..776ffd78a9a 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -35,6 +35,14 @@ void SmartWaypointMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); + for (UNORDERED_MAP<uint32, WPPath*>::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + { + for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) + delete pathItr->second; + + delete itr->second; + } + waypoint_map.clear(); PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP); @@ -84,6 +92,19 @@ void SmartWaypointMgr::LoadFromDB() sLog->outString(); } +SmartWaypointMgr::~SmartWaypointMgr() +{ + for (UNORDERED_MAP<uint32, WPPath*>::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + { + for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) + delete pathItr->second; + + delete itr->second; + } + + waypoint_map.clear(); +} + void SmartAIMgr::LoadSmartAIFromDB() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 007b57b52d7..e2cd75ee62c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1230,9 +1230,9 @@ typedef UNORDERED_MAP<uint32, ObjectList*> ObjectListMap; class SmartWaypointMgr { friend class ACE_Singleton<SmartWaypointMgr, ACE_Null_Mutex>; - SmartWaypointMgr(){}; + SmartWaypointMgr() {} public: - ~SmartWaypointMgr(){}; + ~SmartWaypointMgr(); void LoadFromDB(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 19f897fece3..51ed3b915fc 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -252,6 +252,10 @@ ObjectMgr::~ObjectMgr() itr->second.Clear(); _cacheTrainerSpellStore.clear(); + + for (DungeonEncounterContainer::iterator itr =_dungeonEncounterStore.begin(); itr != _dungeonEncounterStore.end(); ++itr) + for (DungeonEncounterList::iterator encounterItr = itr->second.begin(); encounterItr != itr->second.end(); ++encounterItr) + delete *encounterItr; } void ObjectMgr::AddLocaleString(std::string const& s, LocaleConstant locale, StringVector& data) |