Netplay: Fixed crashes when disconnect from server or stopping server while no game is loaded
This commit is contained in:
parent
f7c170bd9b
commit
66de1ceee1
2 changed files with 9 additions and 3 deletions
|
@ -40,7 +40,10 @@ void GameClientConnection::Shutdown()
|
||||||
_shutdown = true;
|
_shutdown = true;
|
||||||
DisableControllers();
|
DisableControllers();
|
||||||
|
|
||||||
_console->GetControlManager()->UnregisterInputProvider(this);
|
ControlManager* controlManager = _console->GetControlManager();
|
||||||
|
if(controlManager) {
|
||||||
|
controlManager->UnregisterInputProvider(this);
|
||||||
|
}
|
||||||
_console->GetNotificationManager()->SendNotification(ConsoleNotificationType::DisconnectedFromServer);
|
_console->GetNotificationManager()->SendNotification(ConsoleNotificationType::DisconnectedFromServer);
|
||||||
MessageManager::DisplayMessage("NetPlay", "ConnectionLost");
|
MessageManager::DisplayMessage("NetPlay", "ConnectionLost");
|
||||||
_console->GetSettings()->ClearFlags(EmulationFlags::ForceMaxSpeed);
|
_console->GetSettings()->ClearFlags(EmulationFlags::ForceMaxSpeed);
|
||||||
|
|
|
@ -32,8 +32,11 @@ GameServer::~GameServer()
|
||||||
|
|
||||||
Stop();
|
Stop();
|
||||||
|
|
||||||
_console->GetControlManager()->UnregisterInputRecorder(this);
|
ControlManager* controlManager = _console->GetControlManager();
|
||||||
_console->GetControlManager()->UnregisterInputProvider(this);
|
if(controlManager) {
|
||||||
|
controlManager->UnregisterInputRecorder(this);
|
||||||
|
controlManager->UnregisterInputProvider(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameServer::RegisterServerInput()
|
void GameServer::RegisterServerInput()
|
||||||
|
|
Loading…
Add table
Reference in a new issue