aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index 74f6784..74d2af8 100644
--- a/main.c
+++ b/main.c
@@ -128,11 +128,13 @@ int main(int argc, char **argv) {
case 'n':
if (is_maze) {
//FIXME: free it all before generating a new one
+ map_free(map, height);
map = rbt_maze_map(mwidth, mheight, (unsigned int) time(NULL));
+ path_free(path, height);
path = breadth_first_search_path_8dir(map, width, height, start_pos, end_pos, visited, anim);
}
break;
- case 'q': endwin(); return 0;
+ case 'q': map_free(map, height); path_free(path, height); endwin(); return 0;
}
}