mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 20:56:28 +02:00
FpDebugServer: Fixed mem-leak after GetPropList
git-svn-id: trunk@49058 -
This commit is contained in:
parent
50c0c51936
commit
c789c208a0
@ -111,21 +111,25 @@ begin
|
||||
|
||||
result := ACommandClass.Create(FConnectionIdentifier, AnUID, FOnLog);
|
||||
APropCount := GetPropList(result, APropList);
|
||||
for i := 0 to APropCount-1 do
|
||||
begin
|
||||
APropName := APropList^[i]^.Name;
|
||||
AJSonProp := TJSONObject(AJSonCommand).Find(LowerCase(APropName));
|
||||
|
||||
if assigned(AJSonProp) then
|
||||
try
|
||||
for i := 0 to APropCount-1 do
|
||||
begin
|
||||
case APropList^[i]^.PropType^.Kind of
|
||||
tkAString, tkString, tkUString:
|
||||
SetStrProp(result, APropList^[i], AJSonProp.AsString);
|
||||
tkInteger:
|
||||
SetOrdProp(result, APropList^[i], AJSonProp.AsInteger);
|
||||
APropName := APropList^[i]^.Name;
|
||||
AJSonProp := TJSONObject(AJSonCommand).Find(LowerCase(APropName));
|
||||
|
||||
if assigned(AJSonProp) then
|
||||
begin
|
||||
case APropList^[i]^.PropType^.Kind of
|
||||
tkAString, tkString, tkUString:
|
||||
SetStrProp(result, APropList^[i], AJSonProp.AsString);
|
||||
tkInteger:
|
||||
SetOrdProp(result, APropList^[i], AJSonProp.AsInteger);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Freemem(APropList);
|
||||
end;
|
||||
finally
|
||||
AJSonCommand.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user