SUPERNOVA: Fix use-after-free bug when dying
Since the inventory contains pointers to objects from the rooms, we need to clear the inventory before we destroy the rooms and not after!
This commit is contained in:
parent
de03f549ae
commit
c741f733a0
1 changed files with 1 additions and 1 deletions
|
@ -947,6 +947,7 @@ void GameManager::dead(int messageId) {
|
|||
_vm->paletteFadeOut();
|
||||
_vm->removeMessage();
|
||||
|
||||
_inventory.clear();
|
||||
destroyRooms();
|
||||
initRooms();
|
||||
initState();
|
||||
|
@ -955,7 +956,6 @@ void GameManager::dead(int messageId) {
|
|||
else if (_vm->_MSPart == 2)
|
||||
changeRoom(AIRPORT);
|
||||
initGui();
|
||||
_inventory.clear();
|
||||
g_system->fillScreen(kColorBlack);
|
||||
_vm->paletteFadeIn();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue