3.4 event system holding objects?

Bill Schwab bills at an4.anest.ufl.edu
Mon Feb 10 13:43:48 UTC 2003


>> There is also at least one more Alice related straggler, and it
>> interest you.  Is StepMessage something that should be
>> weakened?
> Bill,
> Maybe, maybe not. It might be plausible for an object to expect 
> notification from an event even if that event is the only reference
> the object. Might be nice to have an option for strong or weak 
> MessagesSends.

I agree, but not by default.  By default, it shouldn't be the source of

uncollected garbage, and would require you to hold onto things involved

in an event activation.   This is a rather strongly held opinion of 
mine, unfortunately.

Ned and I did discuss at great length the necessity of having the 
capability to strongly hold references.  In fact, his Connectors 
package overrides the default behavior and does hold them strongly.

Just my 2 asCents, but I've recently been through two tedious rounds of
debugging that were the result of strong references held by event
systems.  One was in a Dolphin extension of mine, the other is the
subject of this thread.  No good can come of it, IMHO.  If an event sink
wants to keep a source alive, it can simply add a strong reference
independent of the event registration - it's as easy as adding and
setting an instance (or global) variable.

> To your specific problem: WonderlandCameraMorph does register
> in some events, but it also has code to de-register that interest.
> question is why that code is not getting called, so if you can 
> remember or invent a simple sequence that recreates this problem, we

> may be able to fix it.

Perhaps he never left that world?

I'm betting on the incomplete event system as the primary culprit.  It
was holding strong references and keeping lots of objects alive. 
Cleaning up the action sequences fixed almost everything, and the few
stragglers disappeared once I stopped stepping of them.


Wilhelm K. Schwab, Ph.D.
University of Florida
Department of Anesthesiology
PO Box 100254
Gainesville, FL 32610-0254

Email: bills at anest4.anest.ufl.edu
Tel: (352) 846-1285
FAX: (352) 392-7029

More information about the Squeak-dev mailing list