From: Ragnar Hojland Espinosa [mailto:ragnar@linalco.com] I want to automatically call self terminate on an object on destruction (or when it goes out of scope..)
Smalltalk objects are not 'destroyed'. They are garbage-collected at some time after no other object references them. The 'some time after' could be microseconds or days.
I can't find out how to write a destructor or something functionally equivalent.
Check out implementors of 'finalize' (IIRC). In essence, you hold onto the object using a weak array; are notified when it is garbage-collected; and clear appropriate fields based on copies of the data in the object.
- Peter