summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-01 00:32:10 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-01 00:32:10 +0300
commit23e0b9550304fa4c8f412c09ce67d307d1878312 (patch)
tree67221624f8bba25ff0847c450a0faf529723db57 /src
parent3d9372a2b17f50cfe2fca55dc59ad2db66df2e97 (diff)
downloadmanaverse-23e0b9550304fa4c8f412c09ce67d307d1878312.tar.gz
manaverse-23e0b9550304fa4c8f412c09ce67d307d1878312.tar.bz2
manaverse-23e0b9550304fa4c8f412c09ce67d307d1878312.tar.xz
manaverse-23e0b9550304fa4c8f412c09ce67d307d1878312.zip
Fix possible crash on exit with opened storage window.
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp3
-rw-r--r--src/game.cpp1
-rw-r--r--src/gui/gui.cpp2
-rw-r--r--src/net/ea/inventoryhandler.cpp4
4 files changed, 8 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 8ab79ae25..939afef18 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -77,6 +77,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/desktop.h"
+#include "gui/widgets/windowcontainer.h"
#include "net/chathandler.h"
#include "net/download.h"
@@ -583,6 +584,8 @@ void Client::gameClear()
eventsManager.shutdown();
WindowManager::deleteWindows();
+ if (windowContainer)
+ windowContainer->slowLogic();
stopTimers();
diff --git a/src/game.cpp b/src/game.cpp
index e7ab0cb10..8495a39a0 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -101,6 +101,7 @@
#include "net/generalhandler.h"
#include "net/gamehandler.h"
+#include "net/inventoryhandler.h"
#include "net/packetcounters.h"
#include "net/serverfeatures.h"
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index b5b1ab414..39ab67be1 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -271,6 +271,8 @@ Gui::~Gui()
delete2(mSecureFont);
delete2(mInfoParticleFont);
delete2(mNpcFont);
+ if (windowContainer)
+ windowContainer->slowLogic();
delete getTop();
delete2(guiInput);
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index e9bc4e236..e540b9bef 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -322,9 +322,9 @@ void InventoryHandler::destroyStorage()
BLOCK_START("InventoryHandler::closeStorage")
if (storageWindow)
{
- storageWindow->unsetInventory();
+ InventoryWindow *const inv = storageWindow;
storageWindow->close();
- storageWindow = nullptr;
+ inv->unsetInventory();
}
BLOCK_END("InventoryHandler::closeStorage")
}