Yes, TBar is TInterfacedObject and is reference counted therefore Free is not 
needed.
Just comment the line //Bar.Free; compile with -gh and you will see no memory 
leak.
 
V.
______________________________________________________________
Od: "Marcos Douglas B. Santos" <m...@delfire.net>
Komu: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org>
Datum: 11.03.2018 14:57
Předmět: Re: [fpc-pascal] Using Supports() I got an AV... bug?

On Sun, Mar 11, 2018 at 10:52 AM, Vojtěch Čihák <vojtech.ci...@atlas.cz> wrote:
>
> Hi,
>
> Bar shoud be released by Interface, no need to call Free.

I'm sorry, but `Bar` was defined as `Bar: TBar` so, it's a class not
an interface.

Marcos Douglas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal 
<http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to