From: thefiddler Date: Wed, 23 Jul 2014 19:15:16 +0000 (+0200) Subject: [Mac] Only dispose context on UI thread X-Git-Tag: 2.0-0~105^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6c4a7c9b581e7929acfeec1038f00f2952d0c6c;p=platform%2Fcore%2Fcsapi%2Fopentk.git [Mac] Only dispose context on UI thread --- diff --git a/Source/OpenTK/Platform/MacOS/CocoaContext.cs b/Source/OpenTK/Platform/MacOS/CocoaContext.cs index 89c17e4..58dcec2 100644 --- a/Source/OpenTK/Platform/MacOS/CocoaContext.cs +++ b/Source/OpenTK/Platform/MacOS/CocoaContext.cs @@ -333,6 +333,9 @@ namespace OpenTK Debug.Print("Disposing of Cocoa context."); + if (!NSApplication.IsUIThread) + return; + Cocoa.SendVoid(NSOpenGLContext, Selector.Get("clearCurrentContext")); Cocoa.SendVoid(Handle.Handle, Selector.Get("clearDrawable")); Cocoa.SendVoid(Handle.Handle, Selector.Get("release"));