共用方式為


CComObjectRootEx::FinalRelease

 

You can override this method in your derived class to perform any cleanup required for your object.

Syntax

void FinalRelease( );

Remarks

By default, CComObjectRootEx::FinalRelease does nothing.

Performing cleanup in FinalRelease is preferable to adding code to the destructor of your class since the object is still fully constructed at the point at which FinalRelease is called. This enables you to safely access the methods provided by the most derived class. This is particularly important for freeing any aggregated objects before deletion.

Requirements

Header: atlcom.h

See Also

CComObjectRootEx Class
CComObjectRootEx::FinalConstruct