Fix race between network client disconnect and network window deletion
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "../network_internal.h"
|
||||
#include "../../debug.h"
|
||||
#include "../../error.h"
|
||||
#include "../../window_func.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
@@ -109,6 +110,7 @@ NetworkRecvStatus NetworkGameSocketHandler::CloseConnection(bool error)
|
||||
if (!_network_server && _networking) {
|
||||
extern void ClientNetworkEmergencySave(); // from network_client.cpp
|
||||
ClientNetworkEmergencySave();
|
||||
DeleteNetworkClientWindows();
|
||||
_switch_mode = SM_MENU;
|
||||
_networking = false;
|
||||
ShowErrorMessage(STR_NETWORK_ERROR_LOSTCONNECTION, INVALID_STRING_ID, WL_CRITICAL);
|
||||
|
||||
Reference in New Issue
Block a user