[fpc-pascal] Sigsegv with refcounting interface

José Mejuto joshyfun at gmail.com
Thu Mar 7 13:27:14 CET 2013


El 07/03/2013 12:29, Joao Morais escribió:
> Hello list, what's the problem with "RoundThree" procedure (below)?
> Here it raises a sigsegv trying to read an internal field. The
> difference from "RoundTwo" is that I create an implementation of the
> interface within the first param of tinterfacedlist.add method.

>      writeln('typecasting to v1...');
>      v1 := iintf(vintf[0]);

Hello,

AFAIK you are casting a IUnknown to iintf instead requesting the iintf 
interface. I think the right procedure should be:

v1 := vintf[0] as iintf;

-- 




More information about the fpc-pascal mailing list