[Newbies] Deleting unopened morphs after unit tests

Jerome Peace peace_the_dreamer at yahoo.com
Wed Jun 16 22:24:46 UTC 2010


Hi Sean,

If you add a morph to another morph then you need to delete it.
opening in world is essentially adding the morph to the paste up morph the represents the world.

If the morph is not known by any other morph it will be gc'ed. But there are a lot of ways it could be known, not only as a submorph. Local methods for deletion might also be removing those extra links.

So to answer your question. In some circumstances deletion may not be necessary. Usually it will always be sufficient.

Yours in curiosity and service, --Jerome Peace

--- On Wed, 6/16/10, Sean P. DeNigris <sean at clipperadams.com> wrote:

> From: Sean P. DeNigris <sean at clipperadams.com>
> Subject: [Newbies] Deleting unopened morphs after unit tests
> To: beginners at lists.squeakfoundation.org
> Date: Wednesday, June 16, 2010, 6:02 PM
> 
> http://wiki.squeak.org/squeak/428 says:
>   When you create Morphs, even if you do not do an
> openInWorld, you should
> delete them.
>     ...
>     tearDown
>       aPatchArchiveClient delete
> 
> However, the method comment for Morph>>delete is:
>     "Remove the receiver as a submorph of
> its owner and make its 
>     new owner be nil."
> 
> If the morph was not opened in the world, won't the owner
> of the top-level
> morph already be nil?  I want to update either the
> wiki or the comment to be
> in sync, but I'm not sure which is right.
> 
> Thanks.
> Sean
> -- 
> View this message in context: http://forum.world.st/Deleting-unopened-morphs-after-unit-tests-tp2257950p2257950.html
> Sent from the Squeak - Beginners mailing list archive at
> Nabble.com.
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> 


      


More information about the Beginners mailing list