Re: GC Basic questions
Re: GC Basic questions
- Subject: Re: GC Basic questions
- From: Quincey Morris <email@hidden>
- Date: Tue, 20 Oct 2009 00:07:45 -0700
On Oct 19, 2009, at 23:35, Nick Rogers wrote:
How do I release everything associated with an ivar (pointer to a
class) in AppController?
Currently I'm doing it by setting this pointer as nil. Is it ok?
Urg, I missed the part where you said "AppController". Since that
object is (presumably) never going away, then setting the ivar to nil
is the correct thing to do.
If you do that and the memory isn't freed, then one of two things has
happened. Either the collector hasn't decided to collect this memory
*yet*, or there's another live pointer somewhere that's keeping it
from being collected.
If you suspect the latter, you can use the 'info gc-roots' command in
the debugger to find out what reference is keeping a block of memory
alive.
Hope that's a bit more helpful than my first reply.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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