[fpc-pascal] CMem issue?

dinmil dinmil at gmail.com
Fri Mar 11 13:17:36 CET 2016


program project1;

{$mode delphi}

uses
  cmem,
  Classes, SysUtils;
var
  VBuffer: TBytes;
  VStream: TStream;
begin
  VStream := TBytesStream.Create;
  try
    VBuffer := TEncoding.UTF8.GetBytes('abc');
    VStream.WriteBuffer(VBuffer[0], Length(VBuffer));
  finally
    VStream.Free;
  end;
  writeln('Press any key to finish...');
  readln;
end.          

I tried this with CT540 - it is OK
CT570 with newer compiler gets access violation when in debug. 
If you try application from command prompt then it is OK.

Picture attached
<http://free-pascal-general.1045716.n5.nabble.com/file/n5724518/AccessViolationCmem.png> 




--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/CMem-issue-tp5724477p5724518.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list