diff options
-rw-r--r-- | src/gui/itemamount.cpp | 15 | ||||
-rw-r--r-- | src/gui/itemamount.h | 2 |
2 files changed, 8 insertions, 9 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(); -} diff --git a/src/gui/itemamount.h b/src/gui/itemamount.h index 52b72a38..72db3444 100644 --- a/src/gui/itemamount.h +++ b/src/gui/itemamount.h @@ -77,7 +77,7 @@ class ItemAmountWindow : public Window, static void showWindow(Usage usage, Window *parent, Item *item, int maxRange = 0); - void scheduleDelete(); + ~ItemAmountWindow(); private: static void finish(Item *item, int amount, Usage usage); |