The return value is meant to be used for diagnostic/testing purposes only! The value of nReference only is a "snapshot" of the moment :addRef() was called. When the method returns, another entity may have already changed the object's internal reference count and the return value may be obsolete. Therefore, making assumptions based on nReference is dangerous!
Method AutomationObject():release() Foundation
Decrements the reference count.
:release() --> nReference
The new reference count.
Each COM/ActiveX component knows inherently how often it has been referenced to. As long as its internal reference count has not reached zero, a COM/ActiveX object cannot be freed by its COM server. Thus, every call to :addRef() must have a corresponding call to :release().
:release() is called automatically when method :destroy() is called. Normally, applications need not call :release() directly. See :destroy() for further information.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.