RAD Studio VCL Reference
TInterfacedObject::RefCount Property

Indicates the number of interface pointers currently dependent upon the object.

property RefCount: Integer;
__property Integer RefCount;

System::TInterfacedObject::RefCount defines the lifetime of the object. When System::TInterfacedObject::RefCount is zero, the object is destroyed. 

System::TInterfacedObject::RefCount is incremented by calls to the _AddRef method and decremented by the _Release method.

Note: If the destructor is called on a System::TInterfacedObject descendant that is not fully constructed (an exception was raised in the constructor), then System::TInterfacedObject::RefCount will have a value of 1. Otherwise, System::TInterfacedObject::RefCount will be zero.


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!