mirror of
https://github.com/fltk/fltk.git
synced 2026-05-22 15:22:34 +08:00
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
This commit is contained in:
+8
-3
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user