Browse Source

* Fix from Graeme Geldenhuys to avoid memleaks by early exit

git-svn-id: trunk@37054 -
michael 8 years ago
parent
commit
f6918dac3e
2 changed files with 6 additions and 3 deletions
  1. 1 1
      packages/fcl-report/demos/fcldemo.lpi
  2. 5 2
      packages/fcl-report/demos/udapp.pp

+ 1 - 1
packages/fcl-report/demos/fcldemo.lpi

@@ -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>

+ 5 - 2
packages/fcl-report/demos/udapp.pp

@@ -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;