aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/WaypointManager.cpp6
-rw-r--r--src/game/WaypointManager.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index bd052306992..9bdd8c93734 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -26,6 +26,12 @@
void WaypointStore::Free()
{
+ for (UNORDERED_MAP<uint32, WaypointPath*>::const_iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr)
+ {
+ for (WaypointPath::const_iterator it = itr->second->begin(); it != itr->second->end(); ++it)
+ delete *it;
+ delete itr->second;
+ }
waypoint_map.clear();
}
diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h
index b70d07a9b9b..7efca558146 100644
--- a/src/game/WaypointManager.h
+++ b/src/game/WaypointManager.h
@@ -47,6 +47,7 @@ class WaypointStore
// Null Mutex is OK because WaypointMgr is initialized in the World thread before World is initialized
static WaypointStore* instance() { return ACE_Singleton<WaypointStore, ACE_Null_Mutex>::instance(); }
+ ~WaypointStore() { Free(); }
void UpdatePath(uint32 id);
void Load();
void Free();