From 53586d19df0f07ab3853b59825ef1afe4e244d91 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Thu, 29 Aug 2019 14:47:39 -0400 Subject: [PATCH] add comment abt accessing dispatcher in ThreadedWindowLauncher --- src/client/spark/view/Utility/ThreadedWindowLauncher.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/spark/view/Utility/ThreadedWindowLauncher.cs b/src/client/spark/view/Utility/ThreadedWindowLauncher.cs index 74ac38dd9..2af677603 100644 --- a/src/client/spark/view/Utility/ThreadedWindowLauncher.cs +++ b/src/client/spark/view/Utility/ThreadedWindowLauncher.cs @@ -53,6 +53,7 @@ namespace mbts.ui.utilities { int count = 0; var stopwatch = new Stopwatch(); stopwatch.Start(); + // dc.dispatcher is only assigned once, so it is safe to access it after a null check (despite this being multithreaded code) while (dc.dispatcher == null || dc.dispatcher.HasShutdownStarted) { await Task.Delay(100); if (++count == max_loops) {