Skip to content

Commit 2fb22e1

Browse files
blackspherefollowerqdot
authored andcommitted
Handling a case where the HTTP server stops and cleans up before we get notified.
We handle ObjectDisposedException as an indicator that the connection has been closed. Fixes #269
1 parent ffeb0ae commit 2fb22e1

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

Buttplug.Apps.KiirooEmulatorGUI/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ private void HandleKiirooPlatformMessage(object aObj, UnhandledExceptionEventArg
111111
break;
112112

113113
default:
114+
// There could be other exceptions thrown here, but we don't know what they all are yet.
114115
throw aEvent.ExceptionObject as Exception;
115116
}
116117
}

Buttplug.Components.KiirooPlatformEmulator/KiirooPlatformEmulator.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public async void StartServer()
101101
return;
102102
}
103103
}
104+
catch (ObjectDisposedException)
105+
{
106+
return;
107+
}
104108
catch (Exception e)
105109
{
106110
_log.LogException(e);

0 commit comments

Comments
 (0)