From a850eabf07bd5c620a7329529f464deb4930a127 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Jun 2012 17:40:01 +1000 Subject: TONY: Fix memory leak when game exited whilst credits are active --- engines/tony/custom.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/tony') 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; } -- cgit v1.2.3