From 046620054f3b2817b366e3e3bc01b4a84206dd6f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 5 May 2012 10:56:56 +1000 Subject: TONY: Fix some Valgrind identified memory leaks --- engines/tony/font.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/tony/font.cpp') 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; } -- cgit v1.2.3