Re: Application crashes after launching Open/Save dialogs
Re: Application crashes after launching Open/Save dialogs
- Subject: Re: Application crashes after launching Open/Save dialogs
- From: Jens Alfke <email@hidden>
- Date: Thu, 11 Aug 2011 20:49:47 -0700
On Aug 8, 2011, at 2:34 AM, Sanyam Jain wrote:
> Thread 0 Crashed: Dispatch queue: com.apple.main-thread
> 0 libobjc.A.dylib 0x92dd3eec objc_msgSend + 44
A crash in objc_msgsend means a message was sent to a bad object pointer. Usually this means the object has already been dealloced and so its memory is garbage. (You can read up on NSZombieEnabled in the docs, for a general technique to debug this.)
> 2 com.apple.CoreFoundation 0x93c4e793 __CFXNotificationPost + 947
> 3 com.apple.CoreFoundation 0x93c4e19a _CFXNotificationPostNotification + 186
From this you can deduce that a notification is being delivered. So what’s going on is that one of your objects registered for NSNotifications, but forgot to remove itself as an observer in its -dealloc method, so the NSNotificationCenter still has a dangling pointer to it.
> 11 com.apple.Foundation 0x918ad669 -[NSNotificationCenter postNotificationName:object:] + 56
> 12 com.apple.AppKit 0x93ea151a -[NSTableView _enableSelectionPostingAndPost] + 509
> 13 com.apple.AppKit 0x93eacc17 -[NSTableView selectRowIndexes:byExtendingSelection:] + 168
…And from this, it looks like the notification is posted because a table view’s selection changed.
From this you ought to be able to figure out what class the bug is in and fix it. The rule of thumb is that in ANY class where you register self as an observer with an NSNotificationCenter, you MUST remove self as an observer in the -dealloc method.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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