You are not logged in.
Pages: 1

Hi,
I'm using the fonction "RawByteStringToStream" and I have a simple question: How to free this stream created ?
Thank's
Delphi 2010 - Delphi XE5 (x64 Apps) - CodeTyphon - Typhon IDE v 5.7 - FPC 3.1.1 - mORMot 1.18
Windows 7 - VirtualBox : Linux Debian 8.5 Jessie 32 bits
Offline

I do this :
  temp:=TStream.Create;    
  [...]
  temp := RawByteStringToStream(content);
  [...]
  temp.Free;    but I have the feeling that the stream is not correctly released.
Delphi 2010 - Delphi XE5 (x64 Apps) - CodeTyphon - Typhon IDE v 5.7 - FPC 3.1.1 - mORMot 1.18
Windows 7 - VirtualBox : Linux Debian 8.5 Jessie 32 bits
Offline

I do this :
temp:=TStream.Create; [...] temp := RawByteStringToStream(content); [...] temp.Free;but I have the feeling that the stream is not correctly released.
You should use:
  temp := RawByteStringToStream(content);
  try
    [...]
  finally
    temp.Free;
  end;    Just have a look at RawByteStringToStream() implementation. The stream is created by this function.
Offline

Ok thank you I'm going to test !
Delphi 2010 - Delphi XE5 (x64 Apps) - CodeTyphon - Typhon IDE v 5.7 - FPC 3.1.1 - mORMot 1.18
Windows 7 - VirtualBox : Linux Debian 8.5 Jessie 32 bits
Offline
Pages: 1