FireDAC.Stan.Util.FDFreeAndNil

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure FDFreeAndNil(var AObj);

C++

extern DELPHI_PACKAGE void __fastcall FDFreeAndNil(void *AObj);

Properties

Type Visibility Source Unit Parent
procedure
function
public
FireDAC.Stan.Util.pas
FireDAC.Stan.Util.hpp
FireDAC.Stan.Util FireDAC.Stan.Util

Description

Frees an object reference and replaces the reference with nil (Delphi) or NULL (C++).

Use FDFreeAndNil to ensure that a variable is nil (Delphi) or NULL (C++) after you free the object it references. Pass any variable that represents an object as the AObj parameter. The behavior differs for ARC and non-ARC platforms:

  • ARC--the method calls the DisposeOf method.
  • non-ARC--the method calls the Destroy destructor.

Warning: AObj must be an instance of a TObject descendant.

See Also