diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index 1fe5956ffeae..03cc80d93d3b 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 0f2c2553ecda..88f2d6ed2285 100644 --- a/engines/tony/gfxcore.h +++ b/engines/tony/gfxcore.h @@ -195,7 +195,7 @@ class RMGfxTask { // 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); } };