* Fix from Graeme Geldenhuys to avoid memleaks by early exit

git-svn-id: trunk@37054 -
This commit is contained in:
michael 2017-08-24 14:53:33 +00:00
parent 4f6b0feda3
commit f6918dac3e
2 changed files with 6 additions and 3 deletions

View File

@ -105,7 +105,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="polygon;../units/$(TargetCPU)-$(TargetOS)"/>
<OtherUnitFiles Value="polygon;../src"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>

View File

@ -331,8 +331,7 @@ begin
Writeln('');
Writeln('Known demos for this binary: ');
ListReports(True);
Free;
Halt(Ord(Msg<>''));
ExitCode:=Ord(Msg<>'')
end;
procedure TReportDemoApplication.ListReports(AWithIndentation: boolean);
@ -421,7 +420,11 @@ begin
OnGetApplicationName:=@GetReportAppName;
S:=CheckOptions('lj::hf:r:d:',['list','json::','help','format:','runtime:','demo:']);
if (S<>'') or HasOption('h','help') then
begin
Usage(S);
Terminate;
exit;
end;
if HasOption('l','list') then
begin
ListReports;