From 2990482406710c77280c67f3b7672a569b9d5a92 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 21 Jun 2012 21:30:09 +0200 Subject: TONY: Fix Valgrind warning The loop uses _ctx->msg, so don't delete it until the loop is done. --- engines/tony/custom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/custom.cpp') diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 3a0792252b..35ae8849f1 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1761,9 +1761,9 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes GLOBALS._curBackText = NULL; delete _ctx->text; - delete _ctx->msg; } + delete _ctx->msg; // Try to run the custom function to close the speech if (GLOBALS._mCharacter[nChar]._item) { -- cgit v1.2.3