Morph Must Die!!! (a bug report)
cgreuter at calum.csclub.uwaterloo.ca
Sun Jun 14 03:46:29 UTC 1998
> I seem to have discovered a bug in Morphic. It seems that deleted
> Morphs continue to hang around and bloat the image. I was able to
> reproduce it in the following manner:
OK, it turns out I was wrong about the bug affecting all Morphs.
Rigorous use of Smalltalk>>garbageCollect showed that only instances
of the particular Morphic subclass I'm working on is affected. It
turns out that this Morph accidentally creates a dependency that
doesn't get broken when the Morph is closed (i.e. sent #delete). The
stale Association in DependentsFields keeps the Morph alive.
This Morph is a subclass of SystemWindow, created in the time-honoured
tradition of creating a subclass and making it create the necessary
submorphs. This one creates two submorphs--a custom widget and a
PluggableTextMorph with a TranscriptStream as model. The parent
window has no model.
The dependency between the TranscriptStream and the PluggableTextMorph
is what goes in DependentsFields--closing the window doesn't break it,
so a reference to the PluggableTextMorph (and thus, the whole window)
stays alive. The main window itself doesn't have a model.
Is this a Squeak bug or did I do something wrong? Up until now,
subclassing a Morph and adding submorphs didn't require any other code
to work, which makes this behaviour incongruent with the rest of
It appears that there is a lot to Morphic that I still don't
More information about the Squeak-dev