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

NextPrevUpTopContentsIndex

com-object-destructor

Generic Function
Summary

Called when a COM object loses its last interface pointer.

Package

com

Signature

com-object-destructor object

Arguments

object

A COM object.

Method
Signatures

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

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

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 the object, i.e. where the overall reference count becomes zero. After this, the 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


LispWorks COM/Automation User Guide and Reference Manual - 23 Mar 2017

NextPrevUpTopContentsIndex