Skip to content

Commit

Permalink
TONY: Fixed memory leaks with the Options screen
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Jun 2, 2012
1 parent 3367679 commit c1e6913
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion engines/tony/game.cpp
Expand Up @@ -139,6 +139,7 @@ RMOptionButton::RMOptionButton(const RMRect &pt) {
m_bActive = false;
m_bHasGfx = false;
m_bDoubleState = false;
m_buf = NULL;
}

RMOptionButton::~RMOptionButton() {
Expand Down Expand Up @@ -321,7 +322,7 @@ void RMOptionSlide::AddToList(RMGfxTargetBuffer &bigBuf) {
\****************************************************************************/

RMOptionScreen::RMOptionScreen(void) {
m_nState = MENUGAME;
m_nState = MENUNONE;
m_menu = NULL;
m_HideLoadSave = NULL;
m_QuitConfirm = NULL;
Expand Down Expand Up @@ -379,6 +380,7 @@ RMOptionScreen::RMOptionScreen(void) {


RMOptionScreen::~RMOptionScreen(void) {
CloseState();
}

void RMOptionScreen::RefreshAll(CORO_PARAM) {
Expand Down Expand Up @@ -856,6 +858,8 @@ void RMOptionScreen::CloseState(void) {
m_ButtonSound_SFXOn = NULL;
}
}

m_nState = MENUNONE;
}

void RMOptionScreen::ReInit(RMGfxTargetBuffer &bigBuf) {
Expand Down
3 changes: 2 additions & 1 deletion engines/tony/game.h
Expand Up @@ -252,7 +252,8 @@ class RMOptionScreen : public RMGfxWoodyBuffer {
MENUGFX,
MENUSOUND,
MENULOAD,
MENUSAVE
MENUSAVE,
MENUNONE
};

STATE m_nState;
Expand Down

0 comments on commit c1e6913

Please sign in to comment.