changeset 602:2032ec27b851

fixed small memory leak in map destructor; cameras were not being deleted when the map was deleted.
author vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 06 Sep 2010 16:43:24 +0000
parents 6856cdb22351
children 739d8a43d771
files engine/core/model/structures/map.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/model/structures/map.cpp	Sun Sep 05 00:41:26 2010 +0000
+++ b/engine/core/model/structures/map.cpp	Mon Sep 06 16:43:24 2010 +0000
@@ -59,6 +59,13 @@
 	}
 
 	Map::~Map() {
+        // remove all cameras
+        std::vector<Camera*>::iterator iter = m_cameras.begin();
+        for ( ; iter != m_cameras.end(); ++iter) {
+            delete *iter;
+        }
+        m_cameras.clear();
+
 		deleteLayers();
 	}