aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-05-05 11:56:59 +1000
committerPaul Gilbert2012-05-05 11:56:59 +1000
commitfbee927c6a648ee1e3f162f0ec6b9d298619dd9f (patch)
tree4da963776655414b6747a347e32434dfc60d0fbe
parente0a7b421857636d5cad2e74c971a676733e48c5b (diff)
downloadscummvm-rg350-fbee927c6a648ee1e3f162f0ec6b9d298619dd9f.tar.gz
scummvm-rg350-fbee927c6a648ee1e3f162f0ec6b9d298619dd9f.tar.bz2
scummvm-rg350-fbee927c6a648ee1e3f162f0ec6b9d298619dd9f.zip
TONY: Fix another memory leak identified by Valgrind
-rw-r--r--engines/tony/game.cpp6
-rw-r--r--engines/tony/gfxcore.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp
index 1fe5956ffe..03cc80d93d 100644
--- a/engines/tony/game.cpp
+++ b/engines/tony/game.cpp
@@ -1371,6 +1371,7 @@ bool RMOptionScreen::LoadThumbnailFromSaveState(int nState, byte *lpDestBuf, RMS
RMPointer::RMPointer() {
Common::fill(m_pointer, m_pointer + 16, (RMGfxSourceBuffer8 *)NULL);
+ Common::fill(m_specialPointer, m_specialPointer + 16, (RMItem *)NULL);
}
RMPointer::~RMPointer() {
@@ -1417,6 +1418,11 @@ void RMPointer::Close(void) {
delete m_pointer[i];
m_pointer[i] = NULL;
}
+
+ if (m_specialPointer[i] != NULL) {
+ delete m_specialPointer[i];
+ m_specialPointer[i] = NULL;
+ }
}
}
diff --git a/engines/tony/gfxcore.h b/engines/tony/gfxcore.h
index 0f2c2553ec..88f2d6ed22 100644
--- a/engines/tony/gfxcore.h
+++ b/engines/tony/gfxcore.h
@@ -195,7 +195,7 @@ public:
// Registration
virtual void Register(void) { m_nInList++; }
- virtual void Unregister(void) { m_nInList--; assert(m_nInList>=0); }
+ virtual void Unregister(void) { m_nInList--; assert(m_nInList >= 0); }
};