From a1bd0179b28fa93c771bc5602f64746878f0ffad Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Jul 2013 20:00:46 +0300 Subject: fix some leaks on exit. --- src/gui/inventorywindow.cpp | 2 +- src/gui/widgets/dropdown.cpp | 5 +++-- src/gui/widgets/dropdown.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 323830e33..a9a096d73 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -275,7 +275,7 @@ InventoryWindow::~InventoryWindow() if (!invInstances.empty()) invInstances.front()->updateDropButton(); - mSortDropDown->hideDrop(); + mSortDropDown->hideDrop(false); delete mSortModel; mSortModel = nullptr; //delete mTextPopup; diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 4ebbcc001..e8d4006a2 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -355,9 +355,10 @@ void DropDown::keyPressed(gcn::KeyEvent& keyEvent) keyEvent.consume(); } -void DropDown::hideDrop() +void DropDown::hideDrop(bool event) { - distributeActionEvent(); + if (event) + distributeActionEvent(); mPopup->setVisible(false); } diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index da0251260..58b01b288 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -118,7 +118,7 @@ class DropDown final : public gcn::ActionListener, void foldUp(); - void hideDrop(); + void hideDrop(bool event = true); int getSelected() const; -- cgit v1.2.3-70-g09d2