[fpc-pascal] Re: Passing objects to libraries and back

Michael Van Canneyt michael at freepascal.org
Sat Feb 26 11:15:45 CET 2011

On Fri, 25 Feb 2011, leledumbo wrote:

>> is it allowed ?
> Yes, but watch out that is/as operator might not work as expected.
>> can i pass ansistrings ?
> Yes, but only if you know what you're doing. NEVER modify the passed strings
> (it would confuse the reference counting). Use const parameter all the time.

It will almost certainly lead to memory leaks, because a simple
inside the library with b passed on from the main program, 
will lead to problems as soon as the library is unloaded.

This is also true for strings that are properties of objects.


More information about the fpc-pascal mailing list