Skip to content

Commit

Permalink
TONY: Fix another memory leak identified by Valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed May 5, 2012
1 parent e0a7b42 commit fbee927
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions engines/tony/game.cpp
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion engines/tony/gfxcore.h
Expand Up @@ -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); }
};


Expand Down

0 comments on commit fbee927

Please sign in to comment.