Bläddra i källkod

TProgressThrottler cleanup and fix.

Martijn Laan 2 månader sedan
förälder
incheckning
84fd9c96ad
2 ändrade filer med 3 tillägg och 4 borttagningar
  1. 2 4
      Projects/Src/Setup.ScriptFunc.HelperFunc.pas
  2. 1 0
      Projects/Src/Setup.ScriptFunc.pas

+ 2 - 4
Projects/Src/Setup.ScriptFunc.HelperFunc.pas

@@ -46,11 +46,10 @@ type
     SuiteMask: Word;
   end;
 
-  { Make sure script isn't called crazy often because that would slow the download significantly.
+  { Makes sure script isn't called crazy often because that would slow the download significantly.
     Only reports:
       -At start or finish
-      -If at least 50 ms passed since last report
-  }
+      -If at least 50 ms passed since last report }
   TProgressThrottler = class
   private
     FOnDownloadProgress: TOnDownloadProgress;
@@ -734,7 +733,6 @@ end;
 procedure TProgressThrottler.Reset;
 begin
   FStopWatch.Stop;
-  FLastOkProgress := -1;
 end;
 
 function TProgressThrottler.ThrottleOk(const Progress, ProgressMax: Int64): Boolean;

+ 1 - 0
Projects/Src/Setup.ScriptFunc.pas

@@ -1848,6 +1848,7 @@ var
             raise Exception.Create(FmtSetupMessage1(msgErrorExtractionFailed, GetExceptMessage));
         end;
       finally
+        Throttler.Free;
       end;
     end);
     RegisterScriptFunc('MapArchiveExtensions', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)