From 90982a892d9820663bde5f62ccc333841a547d69 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 25 Jun 2011 01:14:29 +0300 Subject: Fix memory leaks in npchandler and npcdialog classes. --- src/gui/npcdialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui') diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index d8dc68fd1..e8ea3388f 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -139,6 +139,15 @@ NpcDialog::~NpcDialog() { config.removeListener("logNpcInGui", this); + clearLayout(); + + delete mTextBox; + mTextBox = 0; + delete mClearButton; + mClearButton = 0; + delete mButton; + mButton = 0; + // These might not actually be in the layout, so lets be safe delete mScrollArea; mScrollArea = 0; @@ -157,6 +166,9 @@ NpcDialog::~NpcDialog() delete mItemLinkHandler; mItemLinkHandler = 0; + delete mListScrollArea; + mListScrollArea = 0; + instances.remove(this); } -- cgit v1.2.3-70-g09d2