diff options
author | Paul Gilbert | 2012-06-02 17:40:01 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-06-02 17:40:01 +1000 |
commit | a850eabf07bd5c620a7329529f464deb4930a127 (patch) | |
tree | f8917d593395d9c963c71cb0ce91523145565337 /engines | |
parent | ea8c4960c7139440df9416366a78094f4753aa12 (diff) | |
download | scummvm-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.cpp | 8 |
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; } |