Mercurial > fife-parpg
diff engine/core/model/structures/map.cpp @ 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 | c9113e23b004 |
children | d242e6ce6f9f |
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(); }