When an Objective-C foreign object is destroyed (when the reference count becomes zero) and its class was defined by define-objc-class, the runtime system calls objc-object-destroyed
with the associated object of type standard-objc-object to allow cleanups to be done.
The built-in primary method specializing on standard-objc-object does nothing, but typically :after
methods are defined to handle class-specific cleanups. This function should not be called directly.
Defining a method for objc-object-destroyed
is similar to implementing "dealloc"
in Objective-C code.
LispWorks Objective-C and Cocoa Interface User Guide and Reference Manual - 21 Mar 2017