summaryrefslogtreecommitdiff
path: root/src/gui/textcommandeditor.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-16 22:00:30 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-16 22:00:30 +0300
commitfc6e4c75e29c26b46af5d0c17bbd124211563e4c (patch)
tree834b022769009c6c86354e98363a03b9357ce14d /src/gui/textcommandeditor.cpp
parentfa8f48584bcf693ef7293d94dc55161b9020eb3f (diff)
downloadmv-fc6e4c75e29c26b46af5d0c17bbd124211563e4c.tar.gz
mv-fc6e4c75e29c26b46af5d0c17bbd124211563e4c.tar.bz2
mv-fc6e4c75e29c26b46af5d0c17bbd124211563e4c.tar.xz
mv-fc6e4c75e29c26b46af5d0c17bbd124211563e4c.zip
Fix some possible memory leaks.
Diffstat (limited to 'src/gui/textcommandeditor.cpp')
-rw-r--r--src/gui/textcommandeditor.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp
index 019827048..45bff6b03 100644
--- a/src/gui/textcommandeditor.cpp
+++ b/src/gui/textcommandeditor.cpp
@@ -198,13 +198,15 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
mManaField->setRange(0, 500);
mManaField->setWidth(20);
+ mTargetTypeModel = new TargetTypeModel;
mTypeLabel = new Label(_("Target Type:"));
- mTypeDropDown = new DropDown(new TargetTypeModel);
+ mTypeDropDown = new DropDown(mTargetTypeModel);
mTypeDropDown->setActionEventId("type");
mTypeDropDown->addActionListener(this);
+ mIconsModal = new IconsModal;
mIconLabel = new Label(_("Icon:"));
- mIconDropDown = new DropDown(new IconsModal);
+ mIconDropDown = new DropDown(mIconsModal);
mIconDropDown->setActionEventId("icon");
mIconDropDown->addActionListener(this);
mIconDropDown->setSelectedString(mCommand->getIcon());
@@ -214,8 +216,9 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
mMagicLvlField->setRange(0, 5);
mMagicLvlField->setWidth(20);
+ mMagicSchoolModel = new MagicSchoolModel;
mSchoolLabel = new Label(_("Magic School:"));
- mSchoolDropDown = new DropDown(new MagicSchoolModel);
+ mSchoolDropDown = new DropDown(mMagicSchoolModel);
mSchoolDropDown->setActionEventId("school");
mSchoolDropDown->addActionListener(this);
mSchoolDropDown->setSelected(0);
@@ -286,6 +289,12 @@ TextCommandEditor::TextCommandEditor(TextCommand *command):
TextCommandEditor::~TextCommandEditor()
{
+ delete mIconsModal;
+ mIconsModal = 0;
+ delete mTargetTypeModel;
+ mTargetTypeModel = 0;
+ delete mMagicSchoolModel;
+ mMagicSchoolModel = 0;
}
void TextCommandEditor::action(const gcn::ActionEvent &event)