Skip to content

Commit

Permalink
fix(zc): unload other save games when selecting one
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Sep 2, 2023
1 parent b6ca752 commit 5b2dba0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/zc/saves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2089,6 +2089,21 @@ bool saves_select(int32_t index)
else
game->Clear();

// Unload any other games.
for (int i = 0; i < saves.size(); i++)
{
if (i != index)
{
auto& save = saves[i];
if (save.game)
{
save.header = new gamedata_header(save.game->header);
delete save.game;
save.game = nullptr;
}
}
}

return true;
}

Expand Down

0 comments on commit 5b2dba0

Please sign in to comment.