aboutsummaryrefslogtreecommitdiff
path: root/engines/tony
diff options
context:
space:
mode:
authorPaul Gilbert2012-05-13 10:42:03 +1000
committerPaul Gilbert2012-05-13 10:42:03 +1000
commit81e5a19d58274c2845587500db25c94502eb99a3 (patch)
tree52081145aa1c4fe629041deff92e626199fd760e /engines/tony
parent7978eb007c5b03b8eb3148883245cba395e3efd3 (diff)
downloadscummvm-rg350-81e5a19d58274c2845587500db25c94502eb99a3.tar.gz
scummvm-rg350-81e5a19d58274c2845587500db25c94502eb99a3.tar.bz2
scummvm-rg350-81e5a19d58274c2845587500db25c94502eb99a3.zip
TONY: Fix memory leak in displaying hotspot texts
Diffstat (limited to 'engines/tony')
-rw-r--r--engines/tony/font.cpp9
1 files changed, 5 insertions, 4 deletions
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) {