From d5739c06150e4dfd7f602606ef7aaffe4b6db11d Mon Sep 17 00:00:00 2001 From: hnb Date: Tue, 21 Mar 2017 12:05:16 +0000 Subject: [PATCH] codetools: Fix memory leak introduced in r54432 #5667c05f6c (TFPCTargetConfigCache.Includes was not freed in Clear method). Fix mantis #31575. git-svn-id: trunk@54450 - --- components/codetools/definetemplates.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;