[fpc-pascal] Usage of TInterfacedObject. Automatic release?

Cesar Romero cesarliws at gmail.com
Sat May 26 19:54:02 CEST 2007


var
  Manager: TVTDragManager;

It should be Interface.

like

var
  Manager: IDropSource;

or other implemented interface

[]s


Cesar Romero

Luiz Americo Pereira Camara escreveu:
> I'm tracing a memory leak in a Delphi ported component and found that 
> the culprit was a TInterfacedObject descendant that was not being freed.
>
> I found that if  i directly call Free or _Release the memory leak 
> vanishes (Delphi code does not call these).
>
> My question is: is TInterfacedObject descendants supposed to be freed 
> automatically or should i call Free directly?
>
> See attached example.
>
> Using fpc 2.1.4 under win32 XP SP2.
>
> Luiz
> ------------------------------------------------------------------------
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list