mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-04 11:38:22 +00:00
Move early return out of the autorelease pool.
This commit is contained in:
parent
af1e3bdf0f
commit
c02e959f7a
|
@ -340,18 +340,16 @@ namespace OpenTK
|
||||||
|
|
||||||
Debug.Print("Disposing of Cocoa context.");
|
Debug.Print("Disposing of Cocoa context.");
|
||||||
|
|
||||||
|
if (!NSApplication.IsUIThread)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
using (var pool = new NSAutoreleasePool())
|
using (var pool = new NSAutoreleasePool())
|
||||||
{
|
{
|
||||||
if (!NSApplication.IsUIThread)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsCurrent)
|
if (IsCurrent)
|
||||||
{
|
{
|
||||||
Cocoa.SendVoid(NSOpenGLContext, Selector.Get("clearCurrentContext"));
|
Cocoa.SendVoid(NSOpenGLContext, Selector.Get("clearCurrentContext"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Cocoa.SendVoid(Handle.Handle, Selector.Get("clearDrawable"));
|
Cocoa.SendVoid(Handle.Handle, Selector.Get("clearDrawable"));
|
||||||
|
|
Loading…
Reference in a new issue