[Mac] Ensure Cocoa bindings are initialized first
authorthefiddler <stapostol@gmail.com>
Wed, 23 Jul 2014 12:35:51 +0000 (14:35 +0200)
committerthefiddler <stapostol@gmail.com>
Wed, 23 Jul 2014 12:35:51 +0000 (14:35 +0200)
Source/OpenTK/Platform/MacOS/Cocoa/NSApplication.cs

index e582aba..22295b0 100644 (file)
@@ -41,8 +41,12 @@ namespace OpenTK.Platform.MacOS
 
         static readonly IntPtr selQuit = Selector.Get("quit");
 
-        internal static void Initialize()
+        internal static void Initialize() { }
+
+        static NSApplication()
         {
+            Cocoa.Initialize();
+
             // Create the NSAutoreleasePool
             AutoreleasePool = Cocoa.SendIntPtr(Cocoa.SendIntPtr(Class.NSAutoreleasePool, Selector.Alloc), Selector.Init);