[squeak-dev] Silly question: How do I make a cache registry

Göran Krampe goran at krampe.se
Tue Mar 15 16:11:34 UTC 2011


Hey!

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 mailing list