diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-04-26 20:30:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-04-26 20:30:22 +0300 |
commit | 6b06a89665fdfa9ecc7179bae827cefae3cb1a77 (patch) | |
tree | d90008a75b6d3d883591ccce196b43c94c3cd67c /src/gui/windows/inventorywindow.cpp | |
parent | bcdf34645ff3067d3b4110120b6191af2b0b2e99 (diff) | |
parent | 2ee2f8b060e4fe88feeeba5508189c916e55a70d (diff) | |
download | mv-6b06a89665fdfa9ecc7179bae827cefae3cb1a77.tar.gz mv-6b06a89665fdfa9ecc7179bae827cefae3cb1a77.tar.bz2 mv-6b06a89665fdfa9ecc7179bae827cefae3cb1a77.tar.xz mv-6b06a89665fdfa9ecc7179bae827cefae3cb1a77.zip |
Merge branch 'master' into stablestable
Diffstat (limited to 'src/gui/windows/inventorywindow.cpp')
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index c2a4b4636..01e5e052d 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -271,7 +271,8 @@ void InventoryWindow::postInit() InventoryWindow::~InventoryWindow() { invInstances.remove(this); - mInventory->removeInventoyListener(this); + if (mInventory) + mInventory->removeInventoyListener(this); if (!invInstances.empty()) invInstances.front()->updateDropButton(); @@ -681,7 +682,10 @@ void InventoryWindow::close() else { if (Net::getInventoryHandler()) + { Net::getInventoryHandler()->closeStorage(Inventory::STORAGE); + Net::getInventoryHandler()->forgotStorage(); + } scheduleDelete(); } } @@ -806,3 +810,14 @@ void InventoryWindow::setVisible(bool visible) mSortDropDown->hideDrop(); Window::setVisible(visible); } + +void InventoryWindow::unsetInventory() +{ + if (mInventory) + { + mInventory->removeInventoyListener(this); + if (mItems) + mItems->unsetInventory(); + } + mInventory = nullptr; +} |