Called when a COM object loses its last interface pointer.
com
com-object-destructor object
com-object-destructor (object standard-i-unknown)
com-object-destructor :around (object standard-i-unknown)
object⇩ |
A COM object. |
The generic function com-object-destructor
is called by the implementation of the class standard-i-unknown at the point where the last COM interface pointer is removed for object, i.e. where the overall reference count becomes zero. After this, object is known only to Lisp and is not involved in any COM operations and will be freed as normal by the garbage collector. The built-in primary method specializing on standard-i-unknown does nothing. The build-in around method specializing on standard-i-unknown frees the memory used by the COM interface pointers. Typically, after methods are defined to handle class-specific cleanups.
This function should not be called directly by user code.
(defmethod com-object-destructor :after ((my-doc doc-impl)) (close (document-file my-doc)))
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38