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;
|
||||
DisableControllers();
|
||||
|
||||
_console->GetControlManager()->UnregisterInputProvider(this);
|
||||
ControlManager* controlManager = _console->GetControlManager();
|
||||
if(controlManager) {
|
||||
controlManager->UnregisterInputProvider(this);
|
||||
}
|
||||
_console->GetNotificationManager()->SendNotification(ConsoleNotificationType::DisconnectedFromServer);
|
||||
MessageManager::DisplayMessage("NetPlay", "ConnectionLost");
|
||||
_console->GetSettings()->ClearFlags(EmulationFlags::ForceMaxSpeed);
|
||||
|
|
|
@ -32,8 +32,11 @@ GameServer::~GameServer()
|
|||
|
||||
Stop();
|
||||
|
||||
_console->GetControlManager()->UnregisterInputRecorder(this);
|
||||
_console->GetControlManager()->UnregisterInputProvider(this);
|
||||
ControlManager* controlManager = _console->GetControlManager();
|
||||
if(controlManager) {
|
||||
controlManager->UnregisterInputRecorder(this);
|
||||
controlManager->UnregisterInputProvider(this);
|
||||
}
|
||||
}
|
||||
|
||||
void GameServer::RegisterServerInput()
|
||||
|
|
Loading…
Add table
Reference in a new issue