• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GC Basic questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >GC Basic questions (From: Nick Rogers <email@hidden>)

  • Prev by Date: Re: GC Basic questions
  • Next by Date: Re: Custom NSURLProtocol crashes when using Garbage Collection
  • Previous by thread: Re: GC Basic questions
  • Next by thread: how to make cocoa application run as a command line tool?
  • Index(es):
    • Date
    • Thread