#104, fix error on huge module

This commit is contained in:
Basile Burg 2016-11-15 10:15:23 +01:00
parent b4d44b2eca
commit c5c9fd1d2b
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 5 additions and 1 deletions

View File

@ -93,11 +93,13 @@ var
prs: TJSONParser;
jps: TJSONData;
str: string;
lst: TStringList;
begin
str := getToolName;
if str.isEmpty then
exit;
prc := TProcess.Create(nil);
lst := TStringList.create;
try
prc.Executable := str;
prc.Parameters.Add('-H');
@ -107,7 +109,8 @@ begin
str := source.Text;
prc.Input.Write(str[1], str.length);
prc.CloseInput;
prs := TJSONParser.Create(prc.Output, [joIgnoreTrailingComma, joUTF8]);
processOutputToStrings(prc, lst);
prs := TJSONParser.Create(lst.Text, [joIgnoreTrailingComma, joUTF8]);
jps := prs.Parse;
if jps.isNotNil and (jps.JSONType = jtObject) then
jsn := TJSONObject(jps.Clone);
@ -118,6 +121,7 @@ begin
finally
prs.Free;
prc.Free;
lst.free;
end;
end;