diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-03 10:02:27 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-03 10:02:27 -0400 |
| commit | 9eb9aa82c02a0276df38428895bd840ec8caea02 (patch) | |
| tree | 5621f946a9eac5a7c7ee94f4f3be7990f85beb2d /delegateuitask_darwin.m | |
| parent | 8a81650b3da7ce00725336df9e03b38e935c5a65 (diff) | |
Removed uitask and made the Window creation functions only callable from the main thread. This si the first part in the real major change, which bans all concurrent use of the API and provides a Post() function for communication. I don't like this, but it's the only way. Untested.
Diffstat (limited to 'delegateuitask_darwin.m')
| -rw-r--r-- | delegateuitask_darwin.m | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/delegateuitask_darwin.m b/delegateuitask_darwin.m index 4d38e3a..a1f9501 100644 --- a/delegateuitask_darwin.m +++ b/delegateuitask_darwin.m @@ -56,15 +56,6 @@ extern NSRect dummyRect; @implementation appDelegate -// these are the uitask actions - -- (void)createWindow:(NSValue *)fp -{ - uitask_createWindow([fp pointerValue]); -} - -// these are the other delegate functions - - (BOOL)windowShouldClose:(id)win { return appDelegate_windowShouldClose(win); @@ -115,9 +106,6 @@ id windowGetContentView(id window) return [((NSWindow *) window) contentView]; } -// these are for douitask() but are here because @selector() is not a constant expression -SEL createWindow; - BOOL initCocoa(id appDelegate) { // on 10.6 the -[NSApplication setDelegate:] method complains if we don't have one @@ -131,26 +119,10 @@ BOOL initCocoa(id appDelegate) return NO; [NSApp activateIgnoringOtherApps:YES]; // TODO actually do C.NO here? Russ Cox does YES in his devdraw; the docs say the Finder does NO [NSApp setDelegate:appDelegate]; - // uitask selectors - createWindow = @selector(createWindow:); [pool release]; return YES; } -void douitask(id appDelegate, SEL sel, void *p) -{ - NSAutoreleasePool *pool; - NSValue *fp; - - // we need to make an NSAutoreleasePool, otherwise we get leak warnings on stderr - pool = [NSAutoreleasePool new]; - fp = [NSValue valueWithPointer:p]; - [appDelegate performSelectorOnMainThread:sel - withObject:fp - waitUntilDone:YES]; // wait so we can properly drain the autorelease pool; on other platforms we wind up waiting anyway (since the main thread can only handle one thing at a time) so - [pool release]; -} - void breakMainLoop(void) { NSEvent *e; |
