Re: NSWindow and autorelease with dynamic binary
Re: NSWindow and autorelease with dynamic binary
- Subject: Re: NSWindow and autorelease with dynamic binary
- From: "Wesley Smith" <email@hidden>
- Date: Tue, 15 Jan 2008 10:04:08 -0800
So taking out the extra release call doesn't help at all, that was a
shot in the dark. I checked and isReleasedWhenClosed is enabled, so
after I call [win close], I expect it to be released. Yet, I'm still
getting crashes in
#0 0x90a594c0 in objc_msgSend
#1 0x003cf090 in ??
#2 0x927fb7f6 in +[NSAutoreleasePool releaseAllPools]
#3 0x93423817 in -[NSApplication _deallocHardCore:]
#4 0x934232d1 in -[NSApplication terminate:]
#5 0x93389dbc in -[NSApplication sendAction:to:from:]
#6 0x93437d0f in -[NSMenu performActionForItemAtIndex:]
#7 0x93437a51 in -[NSCarbonMenuImpl
performActionWithHighlightingForItemAtIndex:]
#8 0x934376a8 in -[NSMenu performKeyEquivalent:]
#9 0x93437149 in -[NSApplication _handleKeyEquivalent:]
#10 0x9336adbb in -[NSApplication sendEvent:]
#11 0x93295e1e in -[NSApplication run]
#12 0x93289d4f in NSApplicationMain
#13 0x00002f62 in main at main.m:13
I'm wondering if despite the release, the autoreleasepools still
retain the memory somewhere and expect it at this point (which is
after the dynamic binary has been unlinked. Is there a way to flush
the autorelease pools to test this theory out?
thanks,
wes
On Jan 15, 2008 9:23 AM, John Stiles <email@hidden> wrote:
> Perhaps your window is already set to release-on-close, so the extra
> release is actually a problem?
>
>
> On Jan 15, 2008, at 2:18 AM, Wesley Smith wrote:
>
> > Hi,
> > I've managed to track my crashing problems with a Cocoa dynamically
> > loaded binary down to some NSAutoreleasePool stuff. If I close the
> > NSWindow by clicking on the red button in the topleft, and _then_
> > quite the app, no crashing. If I quite the app with an active window,
> > I do get crashing after the dynamic binary has been unloaded and the
> > app is in its final stack unwind. What happens is:
> >
> > objc_msgSend <-------------------------------------- CRASH
> > EXC_BAD_ACCESSS
> > NSPopAutoReleasePool
> > +[NSAutoreleasePoop releaseAllPools]
> >
> > which makes sense if a reference is left over. My question is how can
> > I guarantee that all such things have been taken care of? In my
> > dynamic binary teardown, I call
> >
> > [window close];
> > [window release];
> >
> > I thought this would be enough but apparently not.
> > Any ideas?
> >
> > thanks,
> > wes
> > _______________________________________________
> >
> > Cocoa-dev mailing list (email@hidden)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> > 40blizzard.com
> >
> > This email sent to email@hidden
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden