X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Frexit.c;h=691cb6840f575e1caac142e49ce8f7d8e33ad6fa;hb=3f1efd2140c58164d692a107aa468048e756036c;hp=6f14663cb8bbac5caac205177430c1b8ff20a11e;hpb=7290dec4219eaa2325aa00ef6139f715743dba3a;p=plomrogue
diff --git a/src/rexit.c b/src/rexit.c
index 6f14663..691cb68 100644
--- a/src/rexit.c
+++ b/src/rexit.c
@@ -4,15 +4,15 @@
#include /* for exit(), free(), defines EXIT_SUCESS, EXIT_FAILURE */
#include /* for printf(), perror() */
#include /* for uint8_t */
-#include /* for endwin() */
#include /* for errno */
#include "main.h" /* for world global */
#include "map.h" /* for Map struct */
#include "keybindings.h" /* for free_keybindings() */
#include "command_db.h" /* for free_command_db() */
-#include "windows.h" /* for Win struct, free_win(), free_winmeta() */
+#include "windows.h" /* for Win struct, free_winmeta_and_endwin() */
#include "map_objects.h" /* for free_map_objects, free_map_object_defs() */
#include "misc.h" /* for unload_interface_conf() */
+#include "map_object_actions.h" /* for free_map_object_actions() */
@@ -24,10 +24,6 @@ static void cleanup();
static void cleanup()
{
- if (cleanup_flags & CLEANUP_NCURSES)
- {
- endwin();
- }
if (cleanup_flags & CLEANUP_MAP_OBJECTS)
{
free_map_objects(world.map_objs);
@@ -44,17 +40,21 @@ static void cleanup()
{
free_command_db();
}
+ if (cleanup_flags & CLEANUP_MAPOBJACTS)
+ {
+ free_map_object_actions(world.map_obj_acts);
+ }
if (cleanup_flags & CLEANUP_MAP)
{
free(world.map->cells);
}
- if (cleanup_flags & CLEANUP_INTERFACE_CONF)
+ if (cleanup_flags & CLEANUP_INTERFACE)
{
- unload_interface_conf(/*&world*/);
+ unload_interface_conf();
}
- if (cleanup_flags & CLEANUP_WIN_META)
+ if (cleanup_flags & CLEANUP_NCURSES)
{
- free_winmeta(world.wmeta);
+ free_winmeta_and_endwin();
}
}