diff options
author | neoraider <devnull@localhost> | 2007-06-15 22:52:01 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2007-06-15 22:52:01 +0200 |
commit | cfa4f3beefabc5cd4e678008b5b3a2bf3fe95a52 (patch) | |
tree | 5d68c773e0a21f0d9f1cf195a515e380d9259076 | |
parent | f5c8fc72ca1801a7771a75d652c58754b36db768 (diff) | |
download | libzoom-cfa4f3beefabc5cd4e678008b5b3a2bf3fe95a52.tar libzoom-cfa4f3beefabc5cd4e678008b5b3a2bf3fe95a52.zip |
zoom: Fixed some Makefile bugs.
-rw-r--r-- | level.c | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -627,35 +627,46 @@ void FreeLevel(LEVEL *level) { if(level) { if(level->info) { - free(level->info->name); - free(level->info->desc); + if(level->info->name) + free(level->info->name); + + if(level->info->desc) + free(level->info->desc); + free(level->info); } - if(level->nRooms) { + if(level->rooms) { for(i = 0; i < level->nRooms; i++) { - if(level->rooms[i].nWalls) free(level->rooms[i].walls); + if(level->rooms[i].walls) + free(level->rooms[i].walls); /*if(level->rooms[i].nThings) free(level->rooms[i].things); if(level->rooms[i].nGates) { free(level->rooms[i].gates); free(level->rooms[i].gateinfo); }*/ - free(level->rooms[i].id); + if(level->rooms[i].id) + free(level->rooms[i].id); } + free(level->rooms); } - if(level->nGates) { + if(level->gates) { for(i = 0; i < level->nGates; i++) { - if(level->gates[i].nWalls) free(level->gates[i].walls); + if(level->gates[i].walls) + free(level->gates[i].walls); } + free(level->gates); } - if(level->nTextures) { - for(i = 0; i < level->nTextures; i++) - free(level->textures[i].name); + if(level->textures) { + for(i = 0; i < level->nTextures; i++) { + if(level->textures[i].name) + free(level->textures[i].name); + } free(level->textures); } |