aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorChristopher Page2008-05-22 23:40:36 +0000
committerChristopher Page2008-05-22 23:40:36 +0000
commit9e4115a3bf5c2d2004f5876a5c9b6b62c2706630 (patch)
tree0515e9f52948ed0808ac6138809b555a329db50d /engines/agos
parent799fb932f421c7833e2afbfd897b6f0c6c90c6e5 (diff)
downloadscummvm-rg350-9e4115a3bf5c2d2004f5876a5c9b6b62c2706630.tar.gz
scummvm-rg350-9e4115a3bf5c2d2004f5876a5c9b6b62c2706630.tar.bz2
scummvm-rg350-9e4115a3bf5c2d2004f5876a5c9b6b62c2706630.zip
AGOS: Fixed a memory leak from earlier in a better way
svn-id: r32219
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/icons.cpp2
-rw-r--r--engines/agos/intern.h1
2 files changed, 1 insertions, 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