[Q] How to dispose of SystemWindow's? They never seem to go away!

Bob Arning arning at charm.net
Sat Jul 15 13:03:57 UTC 2000


On Fri, 14 Jul 2000 21:43:56 -0700 Ned Konz <ned at bike-nomad.com> wrote:
>Well, removing the ones that the image came with (that I know about),
>or that I created, I have (this is the stock image that I got, a 2440
>image from
>the 'net somewhere):
>
>a SystemWindow('TTSampleString' 2882)
>a SystemWindow('arupa 520:Desktop Folder:Squeak2.8a-beo Folder' 3172)
>a SystemWindow('Changes go to "Unnamed1"' 128)
>a SystemWindow('ChangeSet: 2073buttonRowClip-sw' 411)
>a SystemWindow('Selector Browser' 2905)
>a SystemWindow('assembly' 98)
>a SystemWindow('scripting area' 1216)
>a SystemWindow('System Browser' 2509)
>a SystemWindow('Package Browser' 2235)
>a SystemWindow('Workspace' 658)
>
>What's weird about this is that these windows don't get garbage
>collected, even
>after being closed.

Ned,

The first of these is in the Play With Me - 3 project in the initial MVC project. Although you deleted the window manually, it is still contained in the stepList of the worldState of that project. Entering that projects and deleting the window, or simply deleting the project altogether would be the right way to kill this window.

The others all pertain the the right-side global flap. Perhaps one difficulty is the semantics of "delete". In Morphic "delete" means "break the owner<->submorph relationship". This is sufficient to stop drawing the morph on the screen and *usually* suffices to permit the morph to be garbage collected. Where simple deletion does _not_ cause the object to be garbage collected is when there are other referneces. Dependents can be one such example, the flaps are another. The right-side global flap contains a number of MorphThumbnails (small pictures of larger morphs). These are what is displayed in the flap and they have an instance variable <morphRepresented> which is what's preventing garbage collection in these cases. The right way to get rid of these would be to kill the global flap with "destroy this flap" from the red halo manu of the flap in question (see the excellent description of flaps in world menu/windows & flaps/about flaps...

>When I've been working for a while, I get many more. Last time I looked,
>it was
>about 24. Of these, 7 went away finally when I sent "breakDependents" to
>them.
>
>Some are being pointed at by globals or class variables (like, for
>instance,
>the FreeCell high-score window).
>
>I don't know how windows/morphs are supposed to break their
>dependencies;
>is there a specific set of messages that need to be responded to? I've
>seen
>#delete and #release but don't know what each are supposed to do or when
>they
>get called.

Dependents can be messy, Inspect DependentsFields to see some of the main culprits here. Also check the preference morphic/preserveTrash. If this is true, then things deleted with the pink halo are placed in the trash where they can be resurrected if needed. You can empty or view the trash can from world menu/authoring tools...


Hope this helps a bit.

Cheers,
Bob





More information about the Squeak-dev mailing list