Fixed memory leak between areas from automatic surface pool size (#452)

* fixed mem leak

* Add comment to second pop
This commit is contained in:
arthurtilly
2022-07-19 23:24:16 +12:00
committed by GitHub
parent f4b13d474a
commit 1820b146c0
2 changed files with 5 additions and 0 deletions

View File

@@ -360,6 +360,8 @@ static void level_cmd_clear_level(void) {
clear_area_graph_nodes();
clear_areas();
main_pool_pop_state();
// the game does a push on level load and a pop on level unload, we need to add another push to store state after the level has been loaded, so one more pop is needed
main_pool_pop_state();
unmap_tlbs();
sCurrentCmd = CMD_NEXT;
@@ -386,6 +388,7 @@ static void level_cmd_free_level_pool(void) {
break;
}
}
main_pool_push_state();
sCurrentCmd = CMD_NEXT;
}