System.Threading.TThreadPool.TAbstractWorkerData.NewInstance

From RAD Studio API Documentation

Delphi

function ShouldExecute: Boolean; public [Result: Unsafe] class function NewInstance: TObject; override;

C++

__classmethod virtual System::TObject* __fastcall NewInstance();

Properties

Type Visibility Source Unit Parent
function public
System.Threading.pas
System.Threading.hpp
System.Threading TAbstractWorkerData

Description

Allocates memory for each instance of an interfaced object. {{#multireplace:System.Threading.TThreadPool.TAbstractWorkerData.NewInstance|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}} inherits from {{#multireplace:System.TInterfacedObject.NewInstance|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}. All content below this line refers to {{#multireplace:System.TInterfacedObject.NewInstance|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}.

Allocates memory for each instance of an interfaced object.

All constructors call NewInstance automatically. NewInstance calls InstanceSize to determine how much memory to allocate from the heap to contain a particular instance. Do not call NewInstance directly.

TInterfacedObject overrides NewInstance to increment the reference count when a new instance is created. This prevents any constructor from accidentally deleting the instance due to a RefCount of zero. The AfterConstruction method decrements the value of RefCount after all constructors have executed.

See Also