summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-10 12:23:50 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-10 12:23:50 -0600
commit17f9d5abcb05da185486ccfba293f3a8c9eab437 (patch)
tree7545a7bdd3acefc1ff92f345416872c896b90ddb /src/gui
parent4a08d3b4bec3fa0fc1878140b0f14c8b38d6420b (diff)
downloadmana-client-17f9d5abcb05da185486ccfba293f3a8c9eab437.tar.gz
mana-client-17f9d5abcb05da185486ccfba293f3a8c9eab437.tar.bz2
mana-client-17f9d5abcb05da185486ccfba293f3a8c9eab437.tar.xz
mana-client-17f9d5abcb05da185486ccfba293f3a8c9eab437.zip
Fix some mem leaks
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chat.cpp2
-rw-r--r--src/gui/setup.cpp11
-rw-r--r--src/gui/setup.h4
-rw-r--r--src/gui/setup_colors.cpp5
-rw-r--r--src/gui/skill.cpp2
-rw-r--r--src/gui/table.cpp1
-rw-r--r--src/gui/window.cpp2
7 files changed, 21 insertions, 6 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 8ecb5f63..55bc2696 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -108,6 +108,8 @@ ChatWindow::~ChatWindow()
config.setValue("PartyPrefix", partyPrefix);
config.setValue("ReturnToggles", mReturnToggles ? "1" : "0");
delete mRecorder;
+ delete mItemLinkHandler;
+ delete mParty;
}
void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord)
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index 148e8b75..62d79d4d 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -64,9 +64,9 @@ Setup::Setup():
btn->setPosition(x, height - btn->getHeight() - 5);
add(btn);
- // Disable this button when the windows aren't created yet
+ // Store this button, as it needs to be enabled/disabled
if (!strcmp(*curBtn, "Reset Windows"))
- btn->setEnabled(statusWindow != NULL);
+ mResetWindows = btn;
}
TabbedArea *panel = new TabbedArea;
@@ -101,6 +101,8 @@ Setup::Setup():
add(panel);
setLocationRelativeTo(getParent());
+
+ setInGame(false);
}
Setup::~Setup()
@@ -140,3 +142,8 @@ void Setup::action(const gcn::ActionEvent &event)
tradeWindow->resetToDefaultSize();
}
}
+
+void Setup::setInGame(bool inGame)
+{
+ mResetWindows->setEnabled(inGame);
+} \ No newline at end of file
diff --git a/src/gui/setup.h b/src/gui/setup.h
index e4eb0902..075c88bf 100644
--- a/src/gui/setup.h
+++ b/src/gui/setup.h
@@ -31,6 +31,7 @@
#include "../guichanfwd.h"
class SetupTab;
+class Button;
/**
* The setup dialog.
@@ -50,6 +51,8 @@ class Setup : public Window, public gcn::ActionListener
*/
~Setup();
+ void setInGame(bool inGame);
+
/**
* Event handling method.
*/
@@ -57,6 +60,7 @@ class Setup : public Window, public gcn::ActionListener
private:
std::list<SetupTab*> mTabs;
+ gcn::Button *mResetWindows;
};
#endif
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index 49c99996..2610be03 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -57,9 +57,8 @@ Setup_Colors::Setup_Colors() :
mPreview = new BrowserBox(BrowserBox::AUTO_WRAP);
mPreview->setOpaque(false);
- // Replace this later with a more appropriate link handler. For now, this'll
- // do, as it'll do nothing when clicked on.
- mPreview->setLinkHandler(new ItemLinkHandler);
+ // don't do anything with links
+ mPreview->setLinkHandler(NULL);
mPreviewBox = new ScrollArea(mPreview);
mPreviewBox->setHeight(20);
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index 61bb9ce9..6112f0e3 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -163,7 +163,7 @@ SkillDialog::SkillDialog():
SkillDialog::~SkillDialog()
{
- delete mTable;
+ delete_all(mSkillList);
}
void SkillDialog::action(const gcn::ActionEvent &event)
diff --git a/src/gui/table.cpp b/src/gui/table.cpp
index 1371a78e..274f9a48 100644
--- a/src/gui/table.cpp
+++ b/src/gui/table.cpp
@@ -98,6 +98,7 @@ GuiTable::GuiTable(TableModel *initial_model, gcn::Color background,
GuiTable::~GuiTable()
{
+ uninstallActionListeners();
delete mModel;
}
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 8eaaf31d..be63ff21 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -142,6 +142,8 @@ Window::~Window()
delete(w);
}
+ removeWidgetListener(this);
+
instances--;
// Clean up static resources