[fpc-devel] Interfaced Object leak in inherited Object

Hans-Peter Diettrich DrDiettrich at compuserve.de
Mon Jun 13 13:40:33 CEST 2005


alphax wrote:
> 
> It seems a bug in FPC 2.0.0.(Delphi 7.1 also has this bug)
> 
> Assumes there is an object(not class) declaration, the object has a IInterface field. If we declare another object derive from it, in the cleanup procedure of that decendant leak to clear the IInterface references.

Delphi has the special "feature" that dynamic members (AnsiString...)
are initialized and finalized only for base class objects, not for
derived objects. As a rule of thumb: only use Object with old (TP) data
types.

DoDi






More information about the fpc-devel mailing list