NetPlay: Fixed crash when connecting to server if the right game is not already running

This commit is contained in:
Souryo 2016-08-29 22:34:13 -04:00
parent 531e8c4cfe
commit b556c5663e

View file

@ -1526,11 +1526,13 @@ namespace Mesen.GUI.Forms
private void InitializeNsfMode(bool updateTextOnly = false, bool gameLoaded = false)
{
if(this.InvokeRequired) {
if(InteropEmu.IsConnected()) {
InteropEmu.Disconnect();
}
if(InteropEmu.IsServerRunning()) {
InteropEmu.StopServer();
if(InteropEmu.IsNsf()) {
if(InteropEmu.IsConnected()) {
InteropEmu.Disconnect();
}
if(InteropEmu.IsServerRunning()) {
InteropEmu.StopServer();
}
}
this.BeginInvoke((MethodInvoker)(() => this.InitializeNsfMode(updateTextOnly, gameLoaded)));
} else {