Re: Crash on NSMenu
Re: Crash on NSMenu
- Subject: Re: Crash on NSMenu
- From: lbland <email@hidden>
- Date: Sun, 7 Dec 2003 10:19:11 -0500
hi-
I bet you have that crash in mac os x 10.3, but not 10.2? Apple changed
their menu updating and now targets that are no longer valid produce
that crash, at least in the one application where I had to find it. I
imagine the menu updating does some target checking, like checking to
see if the target implements a selector, before updating the menu. In
the case of emptying the menu the checking is probably overkill.
Are you using NSDocument? I bet you have a document component
referenced by a menu and it is on the autorelease pool and is freed
before the menu is updated?
I had a hard time tracking it down because of the non-localized nature
of it and the fact that the error message was indirect. But, it
shouldn't be too hard to figure out what menu item you have that causes
the problem.
-lance
Lance Bland
mailto:email@hidden
VVI
888-VVI-PLOT
http://www.vvi.com
On Sunday, December 7, 2003, at 08:15 AM, Stiphane Sudre wrote:
What's the code you're using? Do you check retainCount?
What's the header of the Crash log?
On dimanche, dicembre 7, 2003, at 12:42 AM, Jean Bovet wrote:
I have a crash with my application in the following way: when I
create a document, I add new menu items to the main menu bar and when
the last document is closed, I remove these items. Sometimes (and
that's the problem) , when I click in the menu bar after removing (or
adding) menu items, the app crash as shown in the crash log below:
Thread 0 Crashed:
#0 0x90831550 in _class_lookupMethodAndLoadCache
(_class_lookupMethodAndLoadCache + 112)
#1 0x908312d8 in objc_msgSend (objc_msgSend + 184)
#2 0x92de78fc in -[NSMenu _enableItems] (-[NSMenu _enableItems] +
312)
#3 0x92e06a64 in -[NSMenu(carbonMenu_Private)
_recursiveEnableItems] (-[NSMenu(carbonMenu_Private)
_recursiveEnableItems] + 36)
#4 0x92e06ab8 in -[NSMenu(carbonMenu_Private)
_recursiveEnableItems] (-[NSMenu(carbonMenu_Private)
_recursiveEnableItems] + 120)
#5 0x92e2ecc0 in _NSHandleCarbonMenuEvent
(_NSHandleCarbonMenuEvent + 140)
#6 0x92dd2dd0 in _DPSNextEvent (_DPSNextEvent + 1232)
#7 0x92de93fc in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] (-[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 116)
#8 0x92dfd730 in -[NSApplication run] (-[NSApplication run] + 540)
#9 0x92eb9a1c in NSApplicationMain (NSApplicationMain + 464)
#10 0x0006c7ec in main (main + 16)
#11 0x000028dc in _start (crt.c:267)
#12 0x0000275c in start (start + 48)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.