From 88bb816428dcba0318e558b65fd65174ecd7ab56 Mon Sep 17 00:00:00 2001 From: Elad Zelingher Date: Fri, 7 Jul 2017 17:35:22 +0300 Subject: [PATCH] Trying to fix #199 --- .../WampSharp/WAMP2/V2/Api/Rx/WampClientSubject.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/net45/WampSharp/WAMP2/V2/Api/Rx/WampClientSubject.cs b/src/net45/WampSharp/WAMP2/V2/Api/Rx/WampClientSubject.cs index 296b202e7..5bb03d9aa 100644 --- a/src/net45/WampSharp/WAMP2/V2/Api/Rx/WampClientSubject.cs +++ b/src/net45/WampSharp/WAMP2/V2/Api/Rx/WampClientSubject.cs @@ -98,7 +98,16 @@ public void Dispose() (mDisposableTask.Exception == null)) { IAsyncDisposable result = mDisposableTask.Result; - result.DisposeAsync(); + result.DisposeAsync().ContinueWith(x => + { + if (x.Exception != null) + { + // Done in order to avoid .NET 4.0 UnhandledException + // Nobody sees this exception anyway. I hope that we + // soon get a version of Reactive Extensions which is more + // suited for remote pub/sub, and allows to return AsyncDispoables. + } + }); } } }