diff options
author | Paul Gilbert | 2012-05-05 10:56:56 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-05 10:56:56 +1000 |
commit | 046620054f3b2817b366e3e3bc01b4a84206dd6f (patch) | |
tree | 911fc3725182760bc7b0ea0a9b325e4d0ab858bf /engines/tony/font.cpp | |
parent | 734fae9193fdabd6dcac5f40f765d904c030f7d1 (diff) | |
download | scummvm-rg350-046620054f3b2817b366e3e3bc01b4a84206dd6f.tar.gz scummvm-rg350-046620054f3b2817b366e3e3bc01b4a84206dd6f.tar.bz2 scummvm-rg350-046620054f3b2817b366e3e3bc01b4a84206dd6f.zip |
TONY: Fix some Valgrind identified memory leaks
Diffstat (limited to 'engines/tony/font.cpp')
-rw-r--r-- | engines/tony/font.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index 42540a2620..28e8f14d38 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -1829,6 +1829,18 @@ RMText::~RMText() { } +void RMText::Unload() { + if (m_fonts[0] != NULL) { + delete m_fonts[0]; + delete m_fonts[1]; + delete m_fonts[2]; + delete m_fonts[3]; + m_fonts[0] = m_fonts[1] = m_fonts[2] = m_fonts[3] = 0; + + g_system->unlockMutex(m_cs); + } +} + void RMText::SetMaxLineLength(int max) { maxLineLength = max; } |