FpDebug: fix mem-leak, if dwarf can't be read

This commit is contained in:
Martin 2024-01-21 11:44:21 +01:00
parent daacf0bfe9
commit 84dc22c63c

View File

@ -5070,7 +5070,7 @@ begin
FFirstScope.Init(nil); // invalid
if not FAbbrevList.Valid then begin
FDwarfSymbolClassMap := DwarfSymbolClassMapList.FDefaultMap.Create(Self, nil);
FDwarfSymbolClassMap := DwarfSymbolClassMapList.FDefaultMap.GetInstanceForCompUnit(Self);
exit;
end;
@ -5082,7 +5082,7 @@ begin
Scope := FScanAllWorker.FindCompileUnit(FScopeList);
if not Scope.IsValid then begin
DebugLn(FPDBG_DWARF_WARNINGS, ['WARNING compilation unit has no compile_unit tag']);
FDwarfSymbolClassMap := DwarfSymbolClassMapList.FDefaultMap.Create(Self, nil);
FDwarfSymbolClassMap := DwarfSymbolClassMapList.FDefaultMap.GetInstanceForCompUnit(Self);
Exit;
end;
FValid := True;