Am 07.09.2017 03:48 schrieb "Ryan Joseph" <r...@thealchemistguild.com>:
>
>
> > On Sep 6, 2017, at 10:20 PM, Sven Barth via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:
> >
> > You're missing that FHook was declared as IHook, not THook.
> >
>
> In terms of memory why does it matter how it was declared? The memory was
allocated in Create() so the declaration is just relevant for the
assignment of the new memory. Is FPC doing something magic behind the
scenes?

a) since it's an interface it doesn't *have* a Free method
b) COM interfaces are reference counted and the compiler (both Delphi and
FPC) does automatic reference counting with them (that's the purpose of
TInterfacedObject, it calls Free on itself once the reference count reaches
0)

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to