BigEndianUnicode produces memory leaks
Original Reporter info from Mantis: grzegorzil
-
Reporter name: Grzegorz Ilczuk
Original Reporter info from Mantis: grzegorzil
- Reporter name: Grzegorz Ilczuk
Description:
Using BigEndianUnicode in a code:
var
Bytes:TBytes;
s: string;
begin
SetLength(Bytes, 28);
Bytes[00]:=$00;
Bytes[01]:=$42;
Bytes[02]:=$00;
Bytes[03]:=$6C;
Bytes[04]:=$00;
Bytes[05]:=$61;
Bytes[06]:=$00;
Bytes[07]:=$68;
Bytes[08]:=$00;
Bytes[09]:=$20;
Bytes[10]:=$00;
Bytes[11]:=$42;
Bytes[12]:=$00;
Bytes[13]:=$6C;
Bytes[14]:=$00;
Bytes[15]:=$61;
Bytes[16]:=$00;
Bytes[17]:=$68;
Bytes[18]:=$00;
Bytes[19]:=$20;
Bytes[20]:=$00;
Bytes[21]:=$42;
Bytes[22]:=$00;
Bytes[23]:=$6C;
Bytes[24]:=$00;
Bytes[25]:=$61;
Bytes[26]:=$00;
Bytes[27]:=$00;
s:=TEncoding.BigEndianUnicode.GetString(Bytes);
produces memory leaks. The same steps are OK if using TEncoding.Unicode.GetString(Bytes);
Steps to reproduce:
Just copy the part of the code from the description and try to run it.
I have used the latest Lazarus 2.0.4 version for it (Linux 64-bit, gtk2), FPC v. 3.0.4
Mantis conversion info:
- Mantis ID: 36240
- Version: 3.0.4
- Fixed in version: 3.3.1
- Target version: 3.2.0