menu: fix memory leak

The start game sequence didn't properly clean up when cancelling out of
a character selection menu if no difficulty selection was presented
(e.g. spell cards)
This commit is contained in:
Andrei Alexeyev 2020-12-28 06:28:53 +02:00
parent 183ae50543
commit 42e88e89f8
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4

View file

@ -115,6 +115,11 @@ static void start_game_do_enter_stage(CallChainResult ccr) {
if(prev_menu && prev_menu->state == MS_Dead) {
assert(prev_menu == ctx->char_menu);
ctx->char_menu = NULL;
if(!ctx->diff_menu) {
start_game_do_cleanup(ccr);
}
return;
}