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

Luiz Americo Pereira Camara luizmed at oi.com.br
Sat May 26 19:48:11 CEST 2007

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: interfaceleak2.pas
Type: text/x-pascal
Size: 915 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070526/aa821c3f/attachment.pas>

More information about the fpc-pascal mailing list