From d5175d1d9cae91de8d67aab6fe5fe7f5defcd63b Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 16 Nov 2009 10:56:07 +0000 Subject: [PATCH] Launch samples on a different thread than the launcher. Samples may install their own message loops and some operating systems do not behave correctly with multiple message loops on a single thread. --- Source/Examples/ExampleBrowser.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Examples/ExampleBrowser.cs b/Source/Examples/ExampleBrowser.cs index da61a3a5..5f615445 100644 --- a/Source/Examples/ExampleBrowser.cs +++ b/Source/Examples/ExampleBrowser.cs @@ -32,6 +32,7 @@ using System.Drawing.Text; using System.Reflection; using System.Windows.Forms; using OpenTK.Examples.Properties; +using System.Threading; namespace Examples { @@ -333,7 +334,11 @@ namespace Examples } Trace.WriteLine(String.Format("Launching sample: \"{0}\"", e.Attribute.Title)); Trace.WriteLine(String.Empty); - main.Invoke(null, null); + + Thread thread = new Thread((ThreadStart)delegate { main.Invoke(null, null); }); + thread.IsBackground = true; + thread.Start(); + thread.Join(); } catch (TargetInvocationException expt) {