[fpc-devel] Bug in PWidechar and refcounting

Peter Vreman peter at freepascal.org
Wed Feb 16 10:18:17 CET 2005


> Alexey Barkovoy wrote:
>> PAnsiChar, PChar are just pointers and not garbage collected by
>> compiler. But
>> AnsiString and WideString are compiler managed types. So, as Peter
>> mentioned,
>> behaviour you are seeing is by design.
>
> In Delphi WideString is not reference counted at all. The layout of the
> string prefix is dictated by the Windows API (BSTR type), and AFAIK
> Windows also doesn't use reference counting with this type, or with
> OLEVariants containing wide strings.

That is something Windows specific. For Kylix it is reference counted.







More information about the fpc-devel mailing list