Look in the archives for weak references and finalization.
On finalization a shadow copy of your object is sent a finalization method after the real object has been GCed. Other smalltalks provide a number of solutions up to including sending a message to your object saying it's going to be GCed and asking if it should be resurrected. (not a squeak solution).
Normally this logic is used to close system resources, say operating system file handles.
see StandardFileStream>>actAsExecutor
finalize
StandardFileStream class>>register: unregister: registry
for clues.
On 1-Jun-06, at 12:26 PM, Bruno Luca wrote:
Hello, i was looking at various method and classes but i didn't find anything interesting about this question. Is there a way to catch GC when deleting an object? Something like a method calling before deleting it...
Byte.
-- www.lethalman.net - Thoughts about computer technologies
-- ======================================================================== === John M. McIntosh johnmci@smalltalkconsulting.com 1-800-477-2659 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ======================================================================== ===