aboutsummaryrefslogtreecommitdiff
path: root/engines/tony
diff options
context:
space:
mode:
authorPaul Gilbert2012-06-02 16:59:58 +1000
committerPaul Gilbert2012-06-02 17:02:07 +1000
commitc1e6913fedf05d18edf6ef64c5a7c1c2cabedd4e (patch)
tree44070050d9a62db50666f60113baf3716ddb8c3b /engines/tony
parent3367679ae80e89dcdbc424af477ee743007050ac (diff)
downloadscummvm-rg350-c1e6913fedf05d18edf6ef64c5a7c1c2cabedd4e.tar.gz
scummvm-rg350-c1e6913fedf05d18edf6ef64c5a7c1c2cabedd4e.tar.bz2
scummvm-rg350-c1e6913fedf05d18edf6ef64c5a7c1c2cabedd4e.zip
TONY: Fixed memory leaks with the Options screen
Diffstat (limited to 'engines/tony')
-rw-r--r--engines/tony/game.cpp6
-rw-r--r--engines/tony/game.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp
index dc5e412f00..a1954b95b2 100644
--- a/engines/tony/game.cpp
+++ b/engines/tony/game.cpp
@@ -139,6 +139,7 @@ RMOptionButton::RMOptionButton(const RMRect &pt) {
m_bActive = false;
m_bHasGfx = false;
m_bDoubleState = false;
+ m_buf = NULL;
}
RMOptionButton::~RMOptionButton() {
@@ -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;
@@ -379,6 +380,7 @@ RMOptionScreen::RMOptionScreen(void) {
RMOptionScreen::~RMOptionScreen(void) {
+ CloseState();
}
void RMOptionScreen::RefreshAll(CORO_PARAM) {
@@ -856,6 +858,8 @@ void RMOptionScreen::CloseState(void) {
m_ButtonSound_SFXOn = NULL;
}
}
+
+ m_nState = MENUNONE;
}
void RMOptionScreen::ReInit(RMGfxTargetBuffer &bigBuf) {
diff --git a/engines/tony/game.h b/engines/tony/game.h
index 20b5f347bc..c920b88ee5 100644
--- a/engines/tony/game.h
+++ b/engines/tony/game.h
@@ -252,7 +252,8 @@ private:
MENUGFX,
MENUSOUND,
MENULOAD,
- MENUSAVE
+ MENUSAVE,
+ MENUNONE
};
STATE m_nState;