[squeak-dev] Silly question: How do I make a cache registry
asqueaker at gmail.com
Tue Mar 15 18:44:15 UTC 2011
Hi Göran, you can find auto-cleaning weak-key and weak-value
dictionary's in the MaBase package on SqueakMap which were developed
by Igor. See the MaDictionary hierarchy.
2011/3/15 Göran Krampe <goran at krampe.se>:
> Say I want to keep a Dictionary with say UUIDs as keys and objects as
> values. And I hand out the UUIDs to an external program as "object handles".
> But if an object gets garbage collected I want the registry to loose that
> association. How?
> WeakValueDictionary only looses the value, not the whole entry.
> Sure, I can use finalization etc, but shouldn't there be a WeakDictionary
> that can do this?
> regards, Göran
More information about the Squeak-dev