summaryrefslogtreecommitdiff
path: root/src/gui/itemamount.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemamount.cpp')
-rw-r--r--src/gui/itemamount.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp
index 71e19e3c..e0162eda 100644
--- a/src/gui/itemamount.cpp
+++ b/src/gui/itemamount.cpp
@@ -148,6 +148,11 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item,
mItemIcon->addMouseListener(this);
}
+ItemAmountWindow::~ItemAmountWindow()
+{
+ delete mItemPopup;
+}
+
// Show ItemTooltip
void ItemAmountWindow::mouseMoved(gcn::MouseEvent &event)
{
@@ -196,7 +201,7 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
else if (event.getId() == "ok")
{
finish(mItem, amount, mUsage);
- scheduleDelete();
+ close();
return;
}
mItemAmountTextField->setValue(amount);
@@ -205,7 +210,7 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
void ItemAmountWindow::close()
{
- delete mItemPopup;
+ keyboard.setEnabled(mEnabledKeyboard);
scheduleDelete();
}
@@ -229,9 +234,3 @@ void ItemAmountWindow::showWindow(Usage usage, Window *parent, Item *item,
new ItemAmountWindow(usage, parent, item, maxRange);
}
}
-
-void ItemAmountWindow::scheduleDelete()
-{
- keyboard.setEnabled(mEnabledKeyboard);
- Window::scheduleDelete();
-}