From 81e5a19d58274c2845587500db25c94502eb99a3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 May 2012 10:42:03 +1000 Subject: TONY: Fix memory leak in displaying hotspot texts --- engines/tony/font.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/tony/font.cpp') diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index 2f8c0c5065..f7f3fb3f8c 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -2272,11 +2272,12 @@ RMTextItemName::~RMTextItemName() { void RMTextItemName::DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &loc, RMPointer &ptr, RMInventory &inv) { CORO_BEGIN_CONTEXT; - RMString itemName; RMItem *lastItem; uint32 hThread; CORO_END_CONTEXT(_ctx); + RMString itemName; + CORO_BEGIN_CODE(_ctx); _ctx->lastItem = m_item; @@ -2294,14 +2295,14 @@ void RMTextItemName::DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation & else m_item = loc.WhichItemIsIn(m_mpos); - _ctx->itemName = ""; + itemName = ""; // If there an item, get it's name if (m_item != NULL) - m_item->GetName(_ctx->itemName); + m_item->GetName(itemName); // Write it - WriteText(_ctx->itemName, 1); + WriteText(itemName, 1); // Handle the change If the selected item is different from the previous one if (_ctx->lastItem != m_item) { -- cgit v1.2.3