Explorar o código

Fix locking for the entire RunIdle callback execution

tznind %!s(int64=2) %!d(string=hai) anos
pai
achega
b87fd489a1
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      Terminal.Gui/Core/MainLoop.cs

+ 5 - 2
Terminal.Gui/Core/MainLoop.cs

@@ -306,9 +306,12 @@ namespace Terminal.Gui {
 
 			Driver.MainIteration ();
 
+			bool runIdle = false;
 			lock (idleHandlersLock) {
-				if (idleHandlers.Count > 0)
-					RunIdle ();
+				runIdle = idleHandlers.Count > 0;
+			}
+			if (runIdle) {
+				RunIdle ();
 			}
 		}