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.
This commit is contained in:
parent
a8c0c7adf4
commit
d5175d1d9c
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue