summaryrefslogtreecommitdiff
path: root/src/koopatlas/mapdata.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-02-18 01:17:10 +0100
committerTreeki <treeki@gmail.com>2012-02-18 01:17:10 +0100
commit147507afe4e4bf84a4fa7ab9bc32531f8e4e2289 (patch)
treef372f54b7d35171c43b901913a55358403604adb /src/koopatlas/mapdata.cpp
parent5c351b910bd4f25a5fdc122d34c435bee28aa861 (diff)
downloadkamek-147507afe4e4bf84a4fa7ab9bc32531f8e4e2289.tar.gz
kamek-147507afe4e4bf84a4fa7ab9bc32531f8e4e2289.zip
fixed memory leaks
Diffstat (limited to 'src/koopatlas/mapdata.cpp')
-rw-r--r--src/koopatlas/mapdata.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp
index a6031b1..fb09f1b 100644
--- a/src/koopatlas/mapdata.cpp
+++ b/src/koopatlas/mapdata.cpp
@@ -34,9 +34,9 @@ dKPMapData_c::dKPMapData_c() {
}
dKPMapData_c::~dKPMapData_c() {
- m_fileLoader.unload();
-
unloadTilesets();
+
+ m_fileLoader.unload();
}
bool dKPMapData_c::load(const char *filename) {
@@ -81,8 +81,13 @@ bool dKPMapData_c::loadTilesets() {
}
void dKPMapData_c::unloadTilesets() {
- if (tilesetLoaders != 0)
+ if (tilesetLoaders != 0) {
+ for (int i = 0; i < data->tilesetCount; i++) {
+ tilesetLoaders[i].unload();
+ }
+
delete[] tilesetLoaders;
+ }
}
void dKPMapData_c::fixup() {