In Pharo2 Object (and many other classes) implement #release and
#release has many senders.  So I don't understand how 'there is no such
thing as #release in Pharo'.  I understand that the GC is a VM thing and
it does not send #release to the objects in the image.


IF in my hypothetical question the Navy object contains an ordered
collection of ships, and each ship is referenced in that collection and
also by all of its soldiers and jobs, to have my ship GC'd do I only
need to remove the reference to the ship in the Navy object (at which
point the ship becomes detached and self contained amalgamation of
soldiers and jobs) or do I have to have each soldier and job dereference
the ship too?




On 06/26/2013 03:05 PM, Camillo Bruni wrote:
> There is no such thing as #release in Pharo. If you want your objects
> to be garbage collected just make sure to remove all references to it.
> You simply assign nil to instance variables which previously held such
> and object.
> 
> Does that answer your question?
> 
> On 2013-06-26, at 23:47, Paul DeBruicker <[email protected]> wrote:
>> Lets say I'm modeling a navy that is comprised of many ships each with
>> their own soldiers and jobs.  If I want one of the ships to be GC'd do I
>> need to implement #release in the soldier and job objects and send it to
>> each of those soldiers and jobs that live and work on the ship I want
>> GC'd or is removing the references between the ship and the navy enough
>> to have the whole ship (including its soldiers and jobs)  GC'd?
> 


Reply via email to