On Apr 9, 2006, at 8:08 AM, Thom McGrath wrote:
I'm working on improving my HIToolbar class and am running into some issues. Since I need to create new toolbar items on demand but keep track of them only until the OS releases them,
I think you should change your way of thinking. In Carbon, if you don't explicitly own a reference, you shouldn't rely on it still being valid at any point in the future.
When you do HIObjectCreate, you get an item with a reference count of 1. This is your reference. The OS will not release it until all references have been released -- In the destructor of your RB class, you should issue an HIObjectRelease, and clean up any references you have to the items. This will honor the contract of you getting 1 reference, then removing it later.
HTH, Jon _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
