Re: NSDrawer dealloc causes kCGErrorIllegalArgument
Re: NSDrawer dealloc causes kCGErrorIllegalArgument
- Subject: Re: NSDrawer dealloc causes kCGErrorIllegalArgument
- From: Greg Parker <email@hidden>
- Date: Mon, 7 Feb 2011 13:04:37 -0800
On Feb 7, 2011, at 12:10 PM, James Walker wrote:
> I have a dialog with a drawer, and when the dialog closes, my console log contains these error messages:
>
> <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 583
> <Error>: kCGErrorIllegalArgument: CGSGetWindowTags: Invalid window 0x247
>
> I set a breakpoint at CGErrorBreakpoint, and when this breakpoint is hit, the stack trace begins:
>
> #0 0x90f9f32a in CGErrorBreakpoint ()
> #1 0x91034c24 in CGSGlobalErrorv ()
> #2 0x90e23b44 in _CGSFindSharedWindow ()
> #3 0x90e10ec7 in _CGSWindowByID ()
> #4 0x90e115c2 in CGSGetWindowTags ()
> #5 0x90083d67 in WindowData::OnActiveSpace ()
> #6 0x90083981 in WindowData::Destruct ()
> #7 0x9193b0cd in _CFRelease ()
> #8 0x93c07e87 in -[NSWindow dealloc] ()
> #9 0x93e0d951 in -[NSDrawer dealloc] ()
> #10 0x9193af38 in CFRelease ()
> #11 0x919655b2 in __CFArrayReleaseValues ()
> #12 0x9193b101 in _CFRelease ()
> #13 0x91967c6d in _CFAutoreleasePoolPop ()
> #14 0x91f1a0aa in NSPopAutoreleasePool ()
> #15 0x919b2222 in CFRunLoopTimerInvalidate ()
>
> So, I'm wondering if I'm doing something wrong (or failing to do something) involving the memory management of the drawer.
>
> The dialog is handled by an object derived from NSWindowController, and this controller is the file's owner of the nib. The NSDrawer is a top-level object of the nib. The docs say that when an NSWindowController is the owner of a nib, it's responsible for cleaning up all the top-level objects, but I wonder if that's really happening.
It could be a memory management error somewhere other than the drawer. Perhaps some other object is being used after deallocation, and the resulting memory smasher hits the CG WindowData object. In any case, you should start with NSZombies and see if it catches any problems before this call to -[NSDrawer dealloc].
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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