Sign in Join
FPDoc Onlineexperiment

TApplication.DoDecLCLRefcountToZero procedure

Member of TApplicationprotectedIn unit Forms

Performs actions needed when the reference count for a TLCLComponent instance reaches 0 in the application.

Declaration

pascal
procedure DoDecLCLRefcountToZero(Sender: TObject)

Description

DoDecLCLRefcountToZero is used in the ReleaseComponent method, and is assigned as the handler routine for the OnDecLCLRefcountToZero event when the LCLRefCount for the TLCLComponent has a value larger than 0.

DoDecLCLRefcountToZero ensures that the global OnDecLCLRefcountToZero handler in lclclasses.pp is unassigned and a call to FreeComponent is queued for asynchronous execution in the application. This is done to prevent an exception that occurs when the component is freed while a previous call to the OnDecLCLRefcountToZero handler is still in process.

Added in LCL version 3.0.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.