From 9e4115a3bf5c2d2004f5876a5c9b6b62c2706630 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Thu, 22 May 2008 23:40:36 +0000 Subject: AGOS: Fixed a memory leak from earlier in a better way svn-id: r32219 --- engines/agos/icons.cpp | 2 -- engines/agos/intern.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp index 0a1877cd9b..7875347d4a 100644 --- a/engines/agos/icons.cpp +++ b/engines/agos/icons.cpp @@ -534,8 +534,6 @@ void AGOSEngine::drawIconArray(uint num, Item *itemRef, int line, int classMask) window->iconPtr->upArrow = _scrollUpHitArea; window->iconPtr->downArrow = _scrollDownHitArea; } - - free (window->iconPtr); } uint AGOSEngine_Feeble::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr) { diff --git a/engines/agos/intern.h b/engines/agos/intern.h index 54cf4dba16..4479e2851e 100644 --- a/engines/agos/intern.h +++ b/engines/agos/intern.h @@ -161,6 +161,7 @@ struct WindowBlock { uint8 fill_color, text_color; IconBlock *iconPtr; WindowBlock() { memset(this, 0, sizeof(*this)); } + ~WindowBlock() { free (iconPtr); } }; // note on text offset: // the actual x-coordinate is: textColumn * 8 + textColumnOffset -- cgit v1.2.3