[fpc-devel] ref count issue with out param

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Jun 13 11:05:54 CEST 2015


Martin Frb wrote:
> ebx is a temp copy of s1, but then f1 becomes nil, and ebx points to
> freed memory.

It's because "out" finalises on the caller side (due to its COM origin, 
I guess) while value parameters get their reference count increased on 
the callee side (for efficiency reasons, I guess). This is all 
Delphi-compatible.


Jonas



More information about the fpc-devel mailing list