set-finalizer!

[procedure] set-finalizer! x proc

Chicken: arranges proc to be called when x is about to be garbage collected.