Re: PDFOutline memory management
Re: PDFOutline memory management
- Subject: Re: PDFOutline memory management
- From: John Calhoun <email@hidden>
- Date: Tue, 17 Apr 2007 19:14:44 -0700
On Apr 17, 2007, at 6:16 PM, Adam R. Maxwell wrote:
I tried that, but unfortunately it only works for the top-level
outline objects. Their children are still created using the base
class.
Yeah, and to make this easier in the future, I made a change in
Leopard so that when children are allocated by a PDFOutline it calls
[[self class] alloc] instead of [PDFOutline alloc]. Thanks for
finding these issues.
In the end, I think just adding each ephemeral child object to an
array before returning it from the outline datasource method is the
safest option, then just releasing that when the datasource
deallocs. It wastes a bunch of memory, but at least it can be
reclaimed when closing the window.
It shouldn't waste anything really. The buggy "retain" in the Tiger
sample code is no better than what you're doing with the array and as
I mentioned Leopard simply does the array thing for you automatically
so no savings there. PDFOutline objects are not really very big
objects....
Good luck.
john calhoun—_______________________________________________
Cocoa-dev mailing list (email@hidden)
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