diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index 3de56b9a95..e55c5c3f01 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -8292,6 +8292,7 @@ begin FreeAndNil(UnitPaths); FreeAndNil(IncludePaths); FreeAndNil(Units); + FreeAndNil(Includes); end; function TFPCTargetConfigCache.Equals(Item: TFPCTargetConfigCache; @@ -8856,7 +8857,7 @@ begin end; // gather all units in all unit and inc files search paths GatherUnitsInSearchPaths(UnitPaths,IncludePaths,OnProgress,Units,Includes,true); - if (UnitPaths=nil) or (UnitPaths.Count=0) then begin + if (UnitPaths.Count=0) then begin if CTConsoleVerbosity>=-1 then debugln(['Warning: [TFPCTargetConfigCache.Update] no unit paths: ',Compiler,' ',ExtraOptions]); end;