diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-07 19:56:51 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-07 19:56:51 -0400 |
| commit | bc848f5c4078b999dbe6ef1cd90e16290a0d1c3a (patch) | |
| tree | 7420a4fb1bd45032f9bf8ce36b8a465b1b6be4ff | |
| parent | 70d7f9fb2a6098c4807e1beb623536ae70a394e3 (diff) | |
Fixed all the NSAutoreleasePool issues on Mac OS X 10.6.
| -rw-r--r-- | delegateuitask_darwin.m | 5 | ||||
| -rw-r--r-- | objc_darwin.m | 2 | ||||
| -rw-r--r-- | todo.md | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/delegateuitask_darwin.m b/delegateuitask_darwin.m index 39bdaa1..d2e6f4f 100644 --- a/delegateuitask_darwin.m +++ b/delegateuitask_darwin.m @@ -126,6 +126,10 @@ id windowGetContentView(id window) BOOL initCocoa(id appDelegate) { + // on 10.6 the -[NSApplication setDelegate:] method complains if we don't have one + NSAutoreleasePool *pool; + + pool = [NSAutoreleasePool new]; dummyRect = NSMakeRect(0, 0, 100, 100); initAreaClass(); [ourApplication sharedApplication]; // makes NSApp an object of type ourApplication @@ -133,6 +137,7 @@ 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]; + [pool release]; return YES; } diff --git a/objc_darwin.m b/objc_darwin.m index 5783244..a5181e8 100644 --- a/objc_darwin.m +++ b/objc_darwin.m @@ -30,7 +30,7 @@ // because the only way to make a new NSControl/NSView is with a frame (it gets overridden later) NSRect dummyRect; -// this can be called before our NSApp is created, so keep a pool +// this can be called before our NSApp is created, so keep a pool to keep 10.6 happy id toNSString(char *str) { NSAutoreleasePool *pool; @@ -1,7 +1,6 @@ MAC OS X: - NSComboBox scans the entered text to see if it matches one of the items and returns the index of that item if it does; find out how to suppress this so that it returns -1 unless the item was chosen from the list (like the other platforms) - asked: http://stackoverflow.com/questions/23046414/cocoa-how-do-i-get-nscombobox-indexofselecteditem-to-return-1-if-the-user-m -- 10.6 also spits a bunch of NSNoAutoreleasePool() debug log messages even though I thoguht I had everything in an NSAutoreleasePool... - make sure Areas get keyboard focus when clicking outside the actual Area space on Mac OS X WINDOWS: |
