Closing a window with a toolbar slow?
Closing a window with a toolbar slow?
- Subject: Closing a window with a toolbar slow?
- From: Glen Low <email@hidden>
- Date: Mon, 23 Feb 2004 17:32:12 +0800
Dear All,
When I close a lot of windows with toolbars in them (50+), the app
spins around doing nothing visible after the last window is no longer
visible. Profiling this section with Shark yields 90+ % spent doing
this:
_CFXNotificationUnregister CoreFoundation
-[NSNotificationCenter removeObserver:name:object:] Foundation
-[NSToolbar _destroyToolbarAssociation:] AppKit
-[NSToolbar _toolbarWillDeallocNotification:] AppKit
_nsnote_callback Foundation
__CFXNotificationPost CoreFoundation
_CFXNotificationPostNotification CoreFoundation
-[NSNotificationCenter postNotificationName:object:userInfo:] Foundation
-[NSToolbar dealloc] AppKit
deallocAuxiliaryStorage AppKit
-[NSWindow dealloc] AppKit
i.e. it spends 90+% in CFXNotificationUnregister, which is called
mostly using the above call sequence, in reverse.
If I insert a
[[NSNotificationCenter defaultCenter] removeObserver: toolbar_]
in my ToolbarController dealloc, the spinning is greatly reduced.
So near as I can figure, the NSToolbar must be removing lots of
notifications before going away.
Any suggestions about what I can do to improve the situation? (I'm
uncomfortable with the removeObserver: message I used since the
messaging could be important to the system.)
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
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.