mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-28 04:47:37 +01:00
+ Patch from Joost Van Der Sluit to fix memory leak
git-svn-id: trunk@4030 -
This commit is contained in:
parent
010482ab05
commit
07f925f991
@ -402,7 +402,11 @@ Var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
S:=TStringStream.Create(Msg);
|
S:=TStringStream.Create(Msg);
|
||||||
|
try
|
||||||
SendMessage(mtString,S);
|
SendMessage(mtString,S);
|
||||||
|
finally
|
||||||
|
s.free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSimpleIPCClient.SendStringmessageFmt(Msg: String;
|
procedure TSimpleIPCClient.SendStringmessageFmt(Msg: String;
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
{$h+}
|
||||||
program ipccerver;
|
program ipccerver;
|
||||||
|
|
||||||
{$APPTYPE CONSOLE}
|
{$APPTYPE CONSOLE}
|
||||||
|
|||||||
@ -157,8 +157,13 @@ Var
|
|||||||
begin
|
begin
|
||||||
FStream.ReadBuffer(Hdr,SizeOf(Hdr));
|
FStream.ReadBuffer(Hdr,SizeOf(Hdr));
|
||||||
Count:=Hdr.MsgLen;
|
Count:=Hdr.MsgLen;
|
||||||
|
if count > 0 then
|
||||||
|
begin
|
||||||
Owner.FMsgData.Seek(0,soFrombeginning);
|
Owner.FMsgData.Seek(0,soFrombeginning);
|
||||||
Owner.FMsgData.CopyFrom(FStream,Count);
|
Owner.FMsgData.CopyFrom(FStream,Count);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Owner.FMsgData.Size := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPipeServerComm.GetInstanceID: String;
|
function TPipeServerComm.GetInstanceID: String;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user