All Manuals > COM/Automation User Guide and Reference Manual > 2 COM Reference Entries

com-object-destructor Generic Function

Summary

Called when a COM object loses its last interface pointer.

Package

com

Signature

com-object-destructor object

Method signatures

com-object-destructor (object standard-i-unknown)

com-object-destructor :around (object standard-i-unknown)

Arguments
object
A COM object.
Description

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.

Examples
(defmethod com-object-destructor :after
                                 ((my-doc doc-impl))
  (close (document-file my-doc)))
See also

com-object-initialize
standard-i-unknown


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38