<p style="padding:0 0 0 0; margin:0 0 0 0;">Yes, TBar is TInterfacedObject and is reference counted therefore Free is not needed.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Just comment the line //Bar.Free; compile with -gh and you will see no memory leak.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">V.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: "Marcos Douglas B. Santos" <md@delfire.net><br />
> Komu: FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org><br />
> Datum: 11.03.2018 14:57<br />
> Předmět: Re: [fpc-pascal] Using Supports() I got an AV... bug?<br />
></p>
On Sun, Mar 11, 2018 at 10:52 AM, Vojtěch Čihák <vojtech.cihak@atlas.cz> wrote:<br />
><br />
> Hi,<br />
><br />
> Bar shoud be released by Interface, no need to call Free.<br />
<br />
I'm sorry, but `Bar` was defined as `Bar: TBar` so, it's a class not<br />
an interface.<br />
<br />
Marcos Douglas<br />
_______________________________________________<br />
fpc-pascal maillist - fpc-pascal@lists.freepascal.org<br />
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>