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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to