On 13/06/2015 15:12, Michael Van Canneyt wrote:
Note the 0 !
Secondly, the section about 'out' parameters is very old; there were
not nearly so much managed types at the time.
I will update it, I was just documenting the new string types anyway.
The above will nicely illustrate the point.
What about the (unverified) remark on the forum that delphi does it
different (apparently passing nil in that case)?
"const" is an exception. The purpose of const is to skip the ref counting.
"Out" has a different purpose. Should it really create a dangling
pointer in a ref counted variable?
In your example you are lucky you got a refcount of 0. The memory is
after-all freed. you called the StringRefCount on a dangling pointer.
Anything could have happen.
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel