mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-21 15:08:37 +00:00
Fixed exception while the Sample Browser is shutting down.
This commit is contained in:
parent
2fd79b720e
commit
7244b80332
|
@ -19,20 +19,25 @@ namespace Examples
|
||||||
|
|
||||||
public override void Write(string message)
|
public override void Write(string message)
|
||||||
{
|
{
|
||||||
_target.Invoke(_invokeWrite, new object[] { message });
|
if (_target.Created)
|
||||||
|
_target.Invoke(_invokeWrite, new object[] { message });
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void WriteLine(string message)
|
public override void WriteLine(string message)
|
||||||
{
|
{
|
||||||
_target.Invoke(_invokeWrite, new object[] { message + Environment.NewLine });
|
if (_target.Created)
|
||||||
|
_target.Invoke(_invokeWrite, new object[] { message + Environment.NewLine });
|
||||||
}
|
}
|
||||||
|
|
||||||
private delegate void StringSendDelegate(string message);
|
private delegate void StringSendDelegate(string message);
|
||||||
private void SendString(string message)
|
private void SendString(string message)
|
||||||
{
|
{
|
||||||
// No need to lock text box as this function will only
|
if (_target.Created)
|
||||||
// ever be executed from the UI thread
|
{
|
||||||
_target.Text += message;
|
// No need to lock text box as this function will only
|
||||||
|
// ever be executed from the UI thread
|
||||||
|
_target.Text += message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue