From 03cad454d70c0fa2839286d6442c60847b2e9735 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 25 Aug 2015 10:57:16 +0000 Subject: It's clearer to implement and use a doNothing: message. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 43e26ebb0..f1d5e74fa 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1113,6 +1113,7 @@ static FLTextView *fltextview_instance = nil; - (void)windowDidMiniaturize:(NSNotification *)notif; - (BOOL)windowShouldClose:(id)fl; - (void)anyWindowWillClose:(NSNotification *)notif; +- (void)doNothing:(id)unused; @end @@ -1410,6 +1411,10 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; } fl_unlock_function(); } +- (void)doNothing:(id)unused +{ + return; +} @end @interface FLAppDelegate : NSObject @@ -1731,10 +1736,10 @@ void fl_open_display() { name:NSWindowWillCloseNotification object:nil]; if (![NSThread isMultiThreaded]) { - // With older OS X versions, it is necessary to create one thread for secondary pthreads to be + // With old OS X versions, it is necessary to create one thread for secondary pthreads to be // allowed to use cocoa, especially to create an NSAutoreleasePool. - // We create a thread that will complete very fast: - [NSThread detachNewThreadSelector:@selector(unhide:) toTarget:NSApp withObject:nil]; + // We create a thread that does nothing so it completes very fast: + [NSThread detachNewThreadSelector:@selector(doNothing:) toTarget:[FLWindowDelegate singleInstance] withObject:nil]; } } } -- cgit v1.2.3