mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-22 11:00:59 +00:00
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
|
@ -32,6 +32,7 @@ using System.Drawing.Text;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using OpenTK.Examples.Properties;
|
using OpenTK.Examples.Properties;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Examples
|
namespace Examples
|
||||||
{
|
{
|
||||||
|
@ -333,7 +334,11 @@ namespace Examples
|
||||||
}
|
}
|
||||||
Trace.WriteLine(String.Format("Launching sample: \"{0}\"", e.Attribute.Title));
|
Trace.WriteLine(String.Format("Launching sample: \"{0}\"", e.Attribute.Title));
|
||||||
Trace.WriteLine(String.Empty);
|
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)
|
catch (TargetInvocationException expt)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue