Dispatcher.PushFrame: clean references before return
[mono.git] / mcs / class / WindowsBase / Test / System.Windows.Threading / DispatcherTest.cs
index 614cef51a43c6a1390b6b468fdeed95edc7a847c..0980ebb12ba6a33c622cde100eeabd2797a6a39d 100644 (file)
@@ -149,6 +149,18 @@ namespace MonoTests.System.Windows.Threading
 
                        Dispatcher.PushFrame(frame);
                }
+
+               [Test]
+               public void TestRunTwice()
+               {
+                       Dispatcher d = Dispatcher.CurrentDispatcher;
+                       Action exit = delegate { Dispatcher.ExitAllFrames(); };
+
+                       d.BeginInvoke(DispatcherPriority.Normal, exit);
+                       Dispatcher.Run();
+                       d.BeginInvoke(DispatcherPriority.Normal, exit);
+                       Dispatcher.Run();
+               }
        }
 }