Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!elroy!aero!obrien From: obrien@anpiel.aero.org (Mike O'Brien) Newsgroups: comp.lang.smalltalk Subject: Re: Unwanted Instances Summary: "release" won't always do the trick Message-ID: <40287@aero.ARPA> Date: 28 Oct 88 20:28:45 GMT References: <4157@tekgvs.GVS.TEK.COM> Sender: news@aero.ARPA Reply-To: obrien@anpiel.UUCP (Mike O'Brien) Distribution: na Organization: The Aerospace Corporation, El Segundo, CA Lines: 39 In article <4157@tekgvs.GVS.TEK.COM> jans@tekgvs.GVS.TEK.COM (Jan Steinman) writes: >Any object that is potentially >circular (which includes any object that stores BlockContexts) should implement >"release", which should always include "super release". "release" should nil >the fields that contain BlockContexts or could be circular. (If you're >dredging up MethodContexts, your obnoxious object probably references >BlockContexts.) > >The need to store BlockContexts is a real problem, but avoiding direct >circularities is a bit easier to deal with. >I've implemented a number of methods for detecting recursion and >carrying on a dialog with a sender, and I find I can often use these instead of >creating circular references. True, "release" is a good first level of defense, and I've written a whole bunch of "release" methods in my time, and even, in desperation, some "superrelease" methods for hand invocation in cases of very stubborn objects. Not even these always work. The basic problem seems to be those cases where an execution error interrupts the normal flow of control and prevents various "release" methods from ever being sent. And in most cases, it is not my own objects which directly hold the circularities. In general my problems have been caused, as best I can determine, by the BlockContexts held by Buttons as actions. I phrased my question in a somewhat more general way in order to elicit the most general possible responses. The only thing I can think of to do is to implement a special case of your "dialog": a set of special release messages which causes a flurry of other "release" messages to be sent down through subsidiary objects, to break up circularities which invade the lower levels. A straight mark-and-sweep GC should still eliminate these, but when things start getting esoteric, it would seem that these interrupted control sequences can leave these low-level things hooked strongly into the remainder of the image. It's very annoying. -- Mike O'Brien obrien@aerospace.aero.org {sdcrdcf,trwrb}!aero!obrien