Skip to content
Permalink
Browse files

Update SingleWindowDispatcherScheduler.cs (#2216)

  • Loading branch information...
glennawatson committed Oct 15, 2019
1 parent 77e160a commit e86935bf86ee6f8c64680f907277b4a8eac3e47d
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/ReactiveUI/Platforms/uap/SingleWindowDispatcherScheduler.cs
@@ -150,7 +150,14 @@ void RaiseToDispatcher(object sender, object e)

private IDisposable ScheduleOnDispatcherNow<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
{
Interlocked.CompareExchange(ref _dispatcher, CoreApplication.Views.FirstOrDefault()?.Dispatcher, null);
try
{
Interlocked.CompareExchange(ref _dispatcher, CoreApplication.Views.FirstOrDefault()?.Dispatcher, null);
}
catch (Exception ex)
{
// Ignore
}

if (_dispatcher == null || _dispatcher.HasThreadAccess)
{

0 comments on commit e86935b

Please sign in to comment.
You can’t perform that action at this time.