From 0c4081f6ef7228c7386f06bd13de7accc9540add Mon Sep 17 00:00:00 2001 From: thefiddler Date: Tue, 22 Jul 2014 16:29:52 +0200 Subject: [PATCH] [Mac] Do not use Autorelease pool --- Source/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs b/Source/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs index cc2d98d..8357de3 100644 --- a/Source/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs +++ b/Source/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs @@ -209,14 +209,13 @@ namespace OpenTK.Platform.MacOS fixed (byte* pBytes = b) { - IntPtr nsData = Cocoa.SendIntPtr(Cocoa.SendIntPtr(Cocoa.SendIntPtr(Class.Get("NSData"), Selector.Alloc), - Selector.Get("initWithBytes:length:"), (IntPtr)pBytes, b.Length), - Selector.Autorelease); + IntPtr nsData = Cocoa.SendIntPtr(Cocoa.SendIntPtr(Class.Get("NSData"), Selector.Alloc), + Selector.Get("initWithBytes:length:"), (IntPtr)pBytes, b.Length); - IntPtr nsImage = Cocoa.SendIntPtr(Cocoa.SendIntPtr(Cocoa.SendIntPtr(Class.Get("NSImage"), Selector.Alloc), - Selector.Get("initWithData:"), nsData), - Selector.Autorelease); + IntPtr nsImage = Cocoa.SendIntPtr(Cocoa.SendIntPtr(Class.Get("NSImage"), Selector.Alloc), + Selector.Get("initWithData:"), nsData); + Cocoa.SendVoid(nsData, Selector.Release); return nsImage; } } -- 2.7.4