aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2012-06-02 17:40:01 +1000
committerPaul Gilbert2012-06-02 17:40:01 +1000
commita850eabf07bd5c620a7329529f464deb4930a127 (patch)
treef8917d593395d9c963c71cb0ce91523145565337 /engines
parentea8c4960c7139440df9416366a78094f4753aa12 (diff)
downloadscummvm-rg350-a850eabf07bd5c620a7329529f464deb4930a127.tar.gz
scummvm-rg350-a850eabf07bd5c620a7329529f464deb4930a127.tar.bz2
scummvm-rg350-a850eabf07bd5c620a7329529f464deb4930a127.zip
TONY: Fix memory leak when game exited whilst credits are active
Diffstat (limited to 'engines')
-rw-r--r--engines/tony/custom.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp
index 03c6405d2e..96b78d0e83 100644
--- a/engines/tony/custom.cpp
+++ b/engines/tony/custom.cpp
@@ -2315,6 +2315,12 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3
uint32 hDisable;
int i;
uint32 startTime;
+
+ ~CoroContextTag() {
+ delete msg;
+ delete[] text;
+ }
+
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
@@ -2368,6 +2374,8 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3
delete[] _ctx->text;
delete _ctx->msg;
+ _ctx->text = NULL;
+ _ctx->msg = NULL;
CORO_END_CODE;
}