summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-02-20 11:32:50 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-02-20 11:32:50 +0000
commit3135c725cc37251943271cd8f939e646c9164259 (patch)
tree159ae31b1c0518d37f5bb21344fe3c72bf5cc382 /src/resources/mapreader.cpp
parent54a359f67da79d97df667299ea4d91cef79c08f2 (diff)
downloadmana-3135c725cc37251943271cd8f939e646c9164259.tar.gz
mana-3135c725cc37251943271cd8f939e646c9164259.tar.bz2
mana-3135c725cc37251943271cd8f939e646c9164259.tar.xz
mana-3135c725cc37251943271cd8f939e646c9164259.zip
Finally equipment! Sometimes it works :P
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 31c2cb75..031188c1 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -82,7 +82,9 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path)
xmlChar *prop;
prop = xmlGetProp(node, BAD_CAST "version");
+#ifndef WIN32
xmlFree(prop);
+#endif
int w = getProperty(node, "width", 0);
int h = getProperty(node, "height", 0);
@@ -142,7 +144,9 @@ void MapReader::readTileset(xmlNodePtr node, const std::string &path, Map *map)
xmlChar* prop = xmlGetProp(node, BAD_CAST "source");
if (prop) {
log("Warning: External tilesets not supported yet.");
+#ifndef WIN32
xmlFree(prop);
+#endif
return;
}
@@ -169,7 +173,9 @@ void MapReader::readTileset(xmlNodePtr node, const std::string &path, Map *map)
Spriteset *set = new Spriteset(tilebmp, tw, th);
//set->setFirstGid(firstgid);
// TODO: Like uhm, do something with this set!
+#ifndef WIN32
xmlFree(source);
+#endif
}
else {
log("Warning: Failed to load tileset (%s)\n", source);
@@ -188,7 +194,9 @@ int MapReader::getProperty(xmlNodePtr node, const char* name, int def)
xmlChar *prop = xmlGetProp(node, BAD_CAST name);
if (prop) {
int val = atoi((char*)prop);
+#ifndef WIN32
xmlFree(prop);
+#endif
return val;
}
else {