From 0a2bc87781c8553d240728fd98f3d7802536a71a Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 26 Sep 2021 16:02:26 +0200 Subject: [PATCH] FpDebug: Fixed mem leak. --- components/fpdebug/fpdbgdwarfdataclasses.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/fpdebug/fpdbgdwarfdataclasses.pas b/components/fpdebug/fpdbgdwarfdataclasses.pas index 9e4a2daddb..550f8b3a0f 100644 --- a/components/fpdebug/fpdbgdwarfdataclasses.pas +++ b/components/fpdebug/fpdbgdwarfdataclasses.pas @@ -3646,6 +3646,7 @@ var n: Integer; CU: TDwarfCompilationUnit; MinMaxSet: boolean; + InfoEntry: TDwarfInformationEntry; begin Result := nil; for n := 0 to FCompilationUnits.Count - 1 do @@ -3660,7 +3661,9 @@ begin if not CU.Valid then // implies FCompUnitScope is ok break; - Result := Cu.DwarfSymbolClassMap.CreateUnitSymbol(CU, TDwarfInformationEntry.Create(CU, CU.FCompUnitScope), Self); + InfoEntry := TDwarfInformationEntry.Create(CU, CU.FCompUnitScope); + Result := Cu.DwarfSymbolClassMap.CreateUnitSymbol(CU, InfoEntry, Self); + InfoEntry.ReleaseReference; break; end; end;