From 39a2ecbd8fc8379c068bc5e0f709229dbe93994f Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Fri, 7 Feb 2014 14:53:17 +0000 Subject: [PATCH] fixed: drag and drop error on mavericks - never create your own instance of NSApplication\! --- src/lib/platform/COSXDragSimulator.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/platform/COSXDragSimulator.m b/src/lib/platform/COSXDragSimulator.m index 1314f38a..a0f44df3 100644 --- a/src/lib/platform/COSXDragSimulator.m +++ b/src/lib/platform/COSXDragSimulator.m @@ -22,7 +22,6 @@ NSWindow* g_dragWindow = NULL; COSXDragView* g_dragView = NULL; -NSApplication* g_app = NULL; void runCocoaApp() @@ -32,9 +31,7 @@ runCocoaApp() NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - - NSApplication* app = [[NSApplication alloc] init]; - g_app = app; + [NSApplication sharedApplication]; NSWindow* window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, 3, 3) @@ -52,7 +49,7 @@ runCocoaApp() [window setContentView: dragView]; NSLog(@"starting cocoa loop"); - [app run]; + [NSApp run]; NSLog(@"cocoa: release"); [pool release]; @@ -61,7 +58,7 @@ runCocoaApp() void stopCocoaLoop() { - [g_app stop: g_dragWindow]; + [NSApp stop: g_dragWindow]; } void