Method AutomationObject():release() Foundation

Decrements the reference count.

Syntax
:release() --> nReference
Return

The new reference count.

Description

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.

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!

Feedback

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.