From: Christian Heller Date: Sat, 31 Aug 2013 01:53:28 +0000 (+0200) Subject: Moved freeing of winmeta into windows library. X-Git-Tag: tce~989 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/te"st.html?a=commitdiff_plain;h=f44e1046dd5fafc71ac481490633ae544c5e5b0c;p=plomrogue Moved freeing of winmeta into windows library. --- diff --git a/src/rexit.c b/src/rexit.c index 8b32d4a..5640d89 100644 --- a/src/rexit.c +++ b/src/rexit.c @@ -10,7 +10,7 @@ #include "map.h" /* for Map struct */ #include "keybindings.h" /* for KeysWinData, KeyBinding structs */ #include "command_db.h" /* for free_command_db() */ -#include "windows.h" /* for Win struct, free_win() */ +#include "windows.h" /* for Win struct, free_win(), free_winmeta() */ #include "map_objects.h" /* for free_item_defs(), free_monster_defs() */ @@ -67,8 +67,7 @@ static void cleanup(struct World * world) } if (cleanup_flags & CLEANUP_WIN_META) { - delwin(world->wins.meta->padframe.curses_win); - free(world->wins.meta); + free_winmeta(world->wins.meta); } if (cleanup_flags & CLEANUP_MAP_OBJECT_DEFS) { diff --git a/src/windows.c b/src/windows.c index df67411..389637b 100644 --- a/src/windows.c +++ b/src/windows.c @@ -440,6 +440,14 @@ extern uint8_t init_win(struct WinMeta * wmeta, struct Win ** wp, char * title, +extern void free_winmeta(struct WinMeta * wmeta) +{ + delwin(wmeta->padframe.curses_win); + free(wmeta); +} + + + extern void free_win(struct Win * win) { if (0 != win->frame.curses_win) diff --git a/src/windows.h b/src/windows.h index aedb30b..5ec4d2f 100644 --- a/src/windows.h +++ b/src/windows.h @@ -119,7 +119,8 @@ extern uint8_t init_win(struct WinMeta * wmeta, struct Win ** w, char * title, -/* Free allocated memory for an initialized Win struct. */ +/* Free allocated memory for an initialized Win / WinMeta struct. */ +extern void free_winmeta(struct WinMeta * wmeta); extern void free_win(struct Win * win);