You can override this method in your derived class to perform any cleanup required for your object.
void FinalRelease( );
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.