Skip to content

Commit

Permalink
libcommon|SaveSlots: Ensure all SaveInfos are free'd when SaveSlots is
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 10, 2014
1 parent 4abb861 commit abb3cd8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doomsday/plugins/common/src/saveslots.cpp
Expand Up @@ -52,6 +52,11 @@ DENG2_PIMPL(SaveSlots)
, nullSaveInfo(0)
{}

~Instance()
{
self.clearSaveInfo();
}

/**
* Determines whether to announce when the specified @a slot is cleared.
*/
Expand Down Expand Up @@ -159,8 +164,9 @@ void SaveSlots::clearSaveInfo()
delete d->nullSaveInfo; d->nullSaveInfo = 0;
}

cvarLastSlot = -1;
cvarQuickSlot = -1;
// Reset last-used and quick-save slot tracking.
Con_SetInteger("game-save-last-slot", -1);
Con_SetInteger("game-save-quick-slot", -1);
}

void SaveSlots::updateAllSaveInfo()
Expand Down

0 comments on commit abb3cd8

Please sign in to comment.