Re: Main window disappears. Sometimes.
Re: Main window disappears. Sometimes.
- Subject: Re: Main window disappears. Sometimes.
- From: mmalc crawford <email@hidden>
- Date: Mon, 02 Jun 2008 11:40:13 -0700
On Jun 2, 2008, at 10:50 AM, Bill Bumgarner wrote:
If your window is sometimes disappearing under GC -- is sometimes
being collected prior to when you think it should be -- that means
that the collector doesn't believe that the window object is being
used by your application. To the collector, being visible doesn't
count as "in use".
In GC, "in use" is defined entirely by whether or not you have a
reference to an object. A pointer to the object somewhere in
scanned memory (of which, any Objective-C object's data will be
"scanned memory").
I wonder if this might be misleading.
Simply because you have a (strong) reference to an object does not
*necessarily* mean that it won't be treated as garbage.
Several objects may have strong references to each other (creating
what in a managed memory environment would be a retain cycle), but if
none of them is a root object, and none of them can be reached via
strong references from a root object, then they will all be treated as
garbage -- see the "F-G-H" example at <http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcEssentials.html
>.
mmalc
_______________________________________________
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