Re: GC Re: Questions about Nib Object Retention
Re: GC Re: Questions about Nib Object Retention
- Subject: Re: GC Re: Questions about Nib Object Retention
- From: "Clark S. Cox III" <email@hidden>
- Date: Wed, 21 Oct 2009 08:41:58 -0700
No, there is no race. While the nib is being loaded, there are plenty
of references to the objects therein on the stack and in registers.
These references will keep these objects alive during loading.
If you don't keep a strong reference to these objects during loading
they will become garbage after nib loading is finished.
Sent from my iPhone
On Oct 21, 2009, at 7:45, Fritz Anderson <email@hidden>
wrote:
All this leads me to the paragraph about top-level objects under
garbage collection:
===
Mac OS X - garbage collected memory model
Most objects in the graph are kept in memory through strong
references between the objects. Only the top-level objects in the
nib file do not have strong references initially. Thus, your code
must create strong references to these objects to prevent the object
graph from being released.
===
Does this mean that there's a race between the NIB loader's need to
create a strong reference and the GC thread's imperative to collect
the object before it is referenced?
― F
_______________________________________________
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
_______________________________________________
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