[BUG] loading new version of RB deletes important methods
Ned Konz
ned at bike-nomad.com
Thu Sep 18 21:53:11 UTC 2003
On Thursday 18 September 2003 01:44 pm, Avi Bryant wrote:
> On Thu, 18 Sep 2003, Ned Konz wrote:
> > It does; the MC v20 update doesn't fix the WeakSet problem,
> > though.
>
> Hm. It does for new installations - I no longer register that
> WeakSet with WeakArray. But for upgrades, it doesn't de-register
> it. This is of course the weak point with Monticello-style
> upgrading that you keep pointing out instances of...
Though some class initializer could do the checking and cleanup (which
in this case would be to remove the registration of that WeakSet with
WeakArray's finalization process.
I had to load a definition of WeakSet>>finalize and then restart the
finalizationProcess which had died.
> The reason I was registering it in the first place was that I found
> that for a WeakKeyDictionary, if I didn't register it with
> WeakArray its items never got GCd. I guess I changed from a
> WeakKeyDictionary to a WeakSet without removing that registration.
> But I still don't entirely understand what's going on - when are
> you *supposed* to use #addWeakDependent:?
If items weren't getting GC'd it was probably because you'd killed off
the finalization process.
addWeakDependent: is only used when you need to have finalizeValues
called. Which for a WeakArray or WeakSet, you really don't have to.
The associated slots should get nil'd out on their own. So in fact
you could have had an empty WeakSet>>finalizeValues that would have
worked as well as what I did.
With the WeakRegistry (or WeakKeyDictionary), you want to be able to
call the associated finalizers to clean up after the registered
objects.
I don't see where the WeakSet's finalization process would get
restarted if killed off. It doesn't seem to be registered with the
StartUpList.
If you open the ProcessBrowser, do you see the finalization process?
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|