Move early return out of the autorelease pool.

This commit is contained in:
Jarl Gullberg 2017-08-04 18:39:44 +02:00
parent af1e3bdf0f
commit c02e959f7a
No known key found for this signature in database
GPG key ID: 750FF6F6BDA72D23

View file

@ -340,18 +340,16 @@ namespace OpenTK
Debug.Print("Disposing of Cocoa context."); Debug.Print("Disposing of Cocoa context.");
using (var pool = new NSAutoreleasePool())
{
if (!NSApplication.IsUIThread) if (!NSApplication.IsUIThread)
{ {
return; return;
} }
using (var pool = new NSAutoreleasePool())
{
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"));