Closing many windows with toolbars very slow
Closing many windows with toolbars very slow
- Subject: Closing many windows with toolbars very slow
- From: Glen Low <email@hidden>
- Date: Tue, 2 Mar 2004 20:41:35 +0800
Dear All,
I tried asking this some time ago on cocoa-dev but got no answer.
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: kludge 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.