From befa79ba4af31b7ec59a45a19b7f5634b420a266 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 12 Feb 2011 21:30:57 +0000 Subject: (svn r22070) -Fix [FS#4503] (r21399): crashes when disconnecting after requesting the map --- src/network/network_server.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 7e870d1c3..463db6855 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -181,8 +181,12 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler() if (this->savegame != NULL) this->savegame->cs = NULL; if (this->savegame_mutex != NULL) this->savegame_mutex->EndCritical(); - /* Make sure the saving is completely cancelled. */ - if (this->savegame != NULL) WaitTillSaved(); + /* Make sure the saving is completely cancelled. + * Yes, we need to handle the save finish as well + * as the next connection in this "loop" might + * just be requesting the map and such. */ + WaitTillSaved(); + ProcessAsyncSaveFinish(); while (this->savegame_packets != NULL) { Packet *p = this->savegame_packets->next; -- cgit v1.2.3-70-g09d2