From: Christian Heller Date: Thu, 2 May 2013 03:32:06 +0000 (+0200) Subject: Cleaning up at the end to eliminate memory leaks detected by valgrind. X-Git-Tag: tce~1321 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/templates?a=commitdiff_plain;h=e8f215126791c763c3168b9bb9083294a42b606c;p=plomrogue Cleaning up at the end to eliminate memory leaks detected by valgrind. --- diff --git a/roguelike.c b/roguelike.c index 7d535bc..6d75aa9 100644 --- a/roguelike.c +++ b/roguelike.c @@ -416,5 +416,13 @@ int main () { update_info (&win_info); update_log (&win_log, "\nYou wait."); } } + free(map.cells); + for (key = 0; key <= world.keyswindata->max; key++) + free(world.keybindings[key].name); + free(world.keybindings); + free(world.keyswindata); + free(win_info.data); + free(win_log.data); + endwin(); return 0; }