From 7d8ea8914bc230d473f558116d932f26f2b5d055 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 18 Apr 2005 21:56:06 +0000 Subject: Fixed tileset loading to clear tilesets vector when finished. --- src/resources/mapreader.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/resources/mapreader.cpp') diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index cf18e4bb..11deacbf 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -76,7 +76,7 @@ Map *MapReader::readMap(const std::string &filename) logger.log("Warning: Not a map file (%s)!", filename.c_str()); return NULL; } - + return readMap(node, filename); xmlFreeDoc(doc); } else { @@ -89,7 +89,7 @@ Map *MapReader::readMap(const std::string &filename) Map* MapReader::readMap(xmlNodePtr node, const std::string &path) { xmlChar *prop; - + // Take the filename off the path std::string pathDir = path.substr(0, path.rfind("/") + 1); @@ -121,6 +121,10 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path) } } + // Clean up tilesets + // TODO: Dereference them somewhere + tilesets.clear(); + return map; } -- cgit v1.2.3-70-g09d2