[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

TInterfacedObject.BeforeDestruction

Check reference count.

Declaration

Source position: objpash.inc line 283

public procedure TInterfacedObject.BeforeDestruction; override;

Description

AfterConstruction overrides the basic method in TObject and adds a reference count check: if the reference count is not zero, an error occurs.

Errors

A runtime-error 204 will be generated if the reference count is nonzero when the object is destroyed.

See also

AfterConstruction

  

Handle reference count properly.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.