hi people,<br>there is a problem with functions returning interfaces:<br>if nobody stores the result, the object decrements one reference despite turn off optimizations.<br><br>sample:<br><br>function getobj: IUnknown;<br>
begin<br> Result := TInterfacedObject.Create;<br>end;<br><br>procedure test;<br>begin<br> getobj;<br> // here result of getobj has died :(<br>end;<br><br>es there a solution or workaround?<br><br>thanks,<br>marianop<br>