[fpc-pascal] Sigsegv with refcounting interface
Flávio Etrusco
flavio.etrusco at gmail.com
Fri Mar 8 20:09:50 CET 2013
>
> var
> vintfl: TInterfaceList;
>
BTW You should use a IInterfaceList variable
> procedure addintf(const aintf: IUnknown);
> (...)
> addintf(TInterfacedObject.Create);
> (...)
It's a pity, but I don't know whether it's fixable (or if needs to be
"fixed") in the compiler.
The TInterfacedObject has RefCount = 0 after construction, so you
should always to assign it to a variable.
In a sense a RefCounted object only exists while someone has a
reference to it, so in that case the object non-existant ;-)
-Flávio
More information about the fpc-pascal
mailing list