+ Patch from Joost Van Der Sluit to fix memory leak

git-svn-id: trunk@4030 -
This commit is contained in:
michael 2006-07-01 08:44:02 +00:00
parent 010482ab05
commit 07f925f991
3 changed files with 14 additions and 3 deletions

View File

@ -402,7 +402,11 @@ Var
begin
S:=TStringStream.Create(Msg);
SendMessage(mtString,S);
try
SendMessage(mtString,S);
finally
s.free;
end;
end;
procedure TSimpleIPCClient.SendStringmessageFmt(Msg: String;

View File

@ -1,3 +1,5 @@
{$mode objfpc}
{$h+}
program ipccerver;
{$APPTYPE CONSOLE}

View File

@ -157,8 +157,13 @@ Var
begin
FStream.ReadBuffer(Hdr,SizeOf(Hdr));
Count:=Hdr.MsgLen;
Owner.FMsgData.Seek(0,soFrombeginning);
Owner.FMsgData.CopyFrom(FStream,Count);
if count > 0 then
begin
Owner.FMsgData.Seek(0,soFrombeginning);
Owner.FMsgData.CopyFrom(FStream,Count);
end
else
Owner.FMsgData.Size := 0;
end;
function TPipeServerComm.GetInstanceID: String;