System.Variants.TCustomVariantType._Release

From RAD Studio API Documentation
Jump to: navigation, search


Delphi

function _Release: Integer; stdcall;

C++

int __stdcall _Release();

Properties

Type Visibility Source Unit Parent
function protected
System.Variants.pas
System.Variants.hpp
System.Variants TCustomVariantType

Description

Responds when the caller releases a reference to this object's interface.

When an application releases an interface that is implemented by TCustomVariantType or one of its descendants, it automatically calls __Release. Typically, interfaced objects use the __Release method to decrement a reference count. When the reference count drops to zero, the object is automatically freed.

TCustomVariantType implements its own version of the IInterface methods _AddRef and __Release that avoid this typical behavior. An application should have only a single instance of TCustomVariantType, and that instance should not be auto-freed when it is not in use. Thus, TCustomVariantType implements __Release so that it always returns –1.

See Also