فهرست منبع

Merge branch 'main' into issigkeys

# Conflicts:
#	Projects/Src/Compiler.SetupCompiler.pas
Martijn Laan 4 ماه پیش
والد
کامیت
8cf341a029
1فایلهای تغییر یافته به همراه36 افزوده شده و 38 حذف شده
  1. 36 38
      Projects/Src/Compiler.SetupCompiler.pas

+ 36 - 38
Projects/Src/Compiler.SetupCompiler.pas

@@ -6644,7 +6644,7 @@ procedure TSetupCompiler.Compile;
     end;
     end;
   end;
   end;
 
 
-  procedure FreeSEListItems(const List: TList; const NumStrings, NumAnsiStrings: Integer);
+  procedure ClearSEList(const List: TList; const NumStrings, NumAnsiStrings: Integer);
   begin
   begin
     for var I := List.Count-1 downto 0 do begin
     for var I := List.Count-1 downto 0 do begin
       SEFreeRec(List[I], NumStrings, NumAnsiStrings);
       SEFreeRec(List[I], NumStrings, NumAnsiStrings);
@@ -6652,15 +6652,7 @@ procedure TSetupCompiler.Compile;
     end;
     end;
   end;
   end;
 
 
-  procedure FreeListItems(const List: TList);
-  begin
-    for var I := List.Count-1 downto 0 do begin
-      Dispose(List[I]);
-      List.Delete(I);
-    end;
-  end;
-
-  procedure FreePreLangData;
+  procedure ClearPreLangDataList;
   var
   var
     I: Integer;
     I: Integer;
   begin
   begin
@@ -6670,7 +6662,7 @@ procedure TSetupCompiler.Compile;
     end;
     end;
   end;
   end;
 
 
-  procedure FreeLangData;
+  procedure ClearLangDataList;
   var
   var
     I: Integer;
     I: Integer;
   begin
   begin
@@ -6680,7 +6672,7 @@ procedure TSetupCompiler.Compile;
     end;
     end;
   end;
   end;
 
 
-  procedure FreeScriptFiles;
+  procedure ClearScriptFiles;
   var
   var
     I: Integer;
     I: Integer;
     SL: TObject;
     SL: TObject;
@@ -6692,7 +6684,7 @@ procedure TSetupCompiler.Compile;
     end;
     end;
   end;
   end;
 
 
-  procedure FreeLineInfoList(L: TStringList);
+  procedure ClearLineInfoList(L: TStringList);
   var
   var
     I: Integer;
     I: Integer;
     LineInfo: TLineInfo;
     LineInfo: TLineInfo;
@@ -8209,39 +8201,45 @@ begin
     { Note: Removing or modifying the copyright text is a violation of the
     { Note: Removing or modifying the copyright text is a violation of the
       Inno Setup license agreement; see LICENSE.TXT. }
       Inno Setup license agreement; see LICENSE.TXT. }
   finally
   finally
+    { Free / clear all the data }
     CallPreprocessorCleanupProc;
     CallPreprocessorCleanupProc;
     UsedUserAreas.Clear;
     UsedUserAreas.Clear;
     WarningsList.Clear;
     WarningsList.Clear;
-    { Free all the data }
     DecompressorDLL.Free;
     DecompressorDLL.Free;
     SetupE32.Free;
     SetupE32.Free;
     WizardSmallImages.Free;
     WizardSmallImages.Free;
     WizardImages.Free;
     WizardImages.Free;
-    FreeSEListItems(LanguageEntries, SetupLanguageEntryStrings, SetupLanguageEntryAnsiStrings);
-    FreeSEListItems(CustomMessageEntries, SetupCustomMessageEntryStrings, SetupCustomMessageEntryAnsiStrings);
-    FreeSEListItems(PermissionEntries, SetupPermissionEntryStrings, SetupPermissionEntryAnsiStrings);
-    FreeSEListItems(TypeEntries, SetupTypeEntryStrings, SetupTypeEntryAnsiStrings);
-    FreeSEListItems(ComponentEntries, SetupComponentEntryStrings, SetupComponentEntryAnsiStrings);
-    FreeSEListItems(TaskEntries, SetupTaskEntryStrings, SetupTaskEntryAnsiStrings);
-    FreeSEListItems(DirEntries, SetupDirEntryStrings, SetupDirEntryAnsiStrings);
-    FreeSEListItems(FileEntries, SetupFileEntryStrings, SetupFileEntryAnsiStrings);
-    FreeSEListItems(FileLocationEntries, SetupFileLocationEntryStrings, SetupFileLocationEntryAnsiStrings);
-    FreeSEListItems(ISSigKeyEntries, SetupISSigKeyEntryStrings, SetupISSigKeyEntryAnsiStrings);
-    FreeSEListItems(IconEntries, SetupIconEntryStrings, SetupIconEntryAnsiStrings);
-    FreeSEListItems(IniEntries, SetupIniEntryStrings, SetupIniEntryAnsiStrings);
-    FreeSEListItems(RegistryEntries, SetupRegistryEntryStrings, SetupRegistryEntryAnsiStrings);
-    FreeSEListItems(InstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
-    FreeSEListItems(UninstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
-    FreeSEListItems(RunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
-    FreeSEListItems(UninstallRunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
+    ClearSEList(LanguageEntries, SetupLanguageEntryStrings, SetupLanguageEntryAnsiStrings);
+    ClearSEList(CustomMessageEntries, SetupCustomMessageEntryStrings, SetupCustomMessageEntryAnsiStrings);
+    ClearSEList(PermissionEntries, SetupPermissionEntryStrings, SetupPermissionEntryAnsiStrings);
+    ClearSEList(TypeEntries, SetupTypeEntryStrings, SetupTypeEntryAnsiStrings);
+    ClearSEList(ComponentEntries, SetupComponentEntryStrings, SetupComponentEntryAnsiStrings);
+    ClearSEList(TaskEntries, SetupTaskEntryStrings, SetupTaskEntryAnsiStrings);
+    ClearSEList(DirEntries, SetupDirEntryStrings, SetupDirEntryAnsiStrings);
+    ClearSEList(FileEntries, SetupFileEntryStrings, SetupFileEntryAnsiStrings);
+    ClearSEList(FileLocationEntries, SetupFileLocationEntryStrings, SetupFileLocationEntryAnsiStrings);
+    ClearSEList(ISSigKeyEntries, SetupISSigKeyEntryStrings, SetupISSigKeyEntryAnsiStrings);
+    ClearSEList(IconEntries, SetupIconEntryStrings, SetupIconEntryAnsiStrings);
+    ClearSEList(IniEntries, SetupIniEntryStrings, SetupIniEntryAnsiStrings);
+    ClearSEList(RegistryEntries, SetupRegistryEntryStrings, SetupRegistryEntryAnsiStrings);
+    ClearSEList(InstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
+    ClearSEList(UninstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
+    ClearSEList(RunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
+    ClearSEList(UninstallRunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
     FileLocationEntryFilenames.Clear;
     FileLocationEntryFilenames.Clear;
-    FreeListItems(FileLocationEntryExtraInfos);
-    FreeListItems(ISSigKeyEntryExtraInfos);
-    FreeLineInfoList(ExpectedCustomMessageNames);
-    FreeLangData;
-    FreePreLangData;
-    FreeScriptFiles;
-    FreeLineInfoList(CodeText);
+    for I := FileLocationEntryExtraInfos.Count-1 downto 0 do begin
+      Dispose(PFileLocationEntryExtraInfo(FileLocationEntryExtraInfos[I]));
+      FileLocationEntryExtraInfos.Delete(I);
+    end;
+    for I := ISSigKeyEntryExtraInfos.Count-1 downto 0 do begin
+      Dispose(PISSigKeyEntryExtraInfo(ISSigKeyEntryExtraInfos[I]));
+      ISSigKeyEntryExtraInfos.Delete(I);
+    end;
+    ClearLineInfoList(ExpectedCustomMessageNames);
+    ClearLangDataList;
+    ClearPreLangDataList;
+    ClearScriptFiles;
+    ClearLineInfoList(CodeText);
     FreeAndNil(CompressProps);
     FreeAndNil(CompressProps);
     FreeAndNil(InternalCompressProps);
     FreeAndNil(InternalCompressProps);
   end;
   end;