X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;f=src%2Fmain.c;h=693f204d9f785d6034e765a33c1a5eb173bbee95;hb=c330529615cc0c5f6772d7e342bc1c442e1f3519;hp=a720191eeeba8106485e6d77a6f9866fcab97a9e;hpb=2e690e2500e66535018bb6e01222442c074cb298;p=plomrogue
diff --git a/src/main.c b/src/main.c
index a720191..693f204 100644
--- a/src/main.c
+++ b/src/main.c
@@ -135,7 +135,7 @@ int main (int argc, char *argv[]) {
else
quit_called = meta_keys(key, &world, &win_meta, &win_keys, &win_map, &win_info, &win_log);
if (1 == quit_called)
- break; } }
+ exit_game(&world, &map); } }
// Interactive mode.
else {
@@ -161,14 +161,4 @@ int main (int argc, char *argv[]) {
else
quit_called = meta_keys(key, &world, &win_meta, &win_keys, &win_map, &win_info, &win_log);
if (1 == quit_called)
- break; } }
-
- // Clean up and exit.
- free(map.cells);
- for (key = 0; key <= world.keyswindata->max; key++)
- free(world.keybindings[key].name);
- free(world.keybindings);
- free(world.keyswindata);
- free(world.log);
- endwin();
- return 0; }
+ exit_game(&world, &map); } } }