there is a problem with functions returning interfaces:
if nobody stores the result, the object decrements one reference despite turn off optimizations.
sample:
function getobj: IUnknown;
begin
Result := TInterfacedObject.Create;
end;
procedure test;
begin
getobj;
// here result of getobj has died :(
end;
es there a solution or workaround?
thanks,
marianop
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel