Merged revision(s) 61808 #e948c7b47a, 61926 #d98120d75f from trunk:

LeakView: fix double free crash. Introduced in r61711 #01fb06cf22 by using TFPGObjectList which does auto free objects
........
LeakView: fix crash due to double free.
........

git-svn-id: branches/fixes_2_0@61927 -
This commit is contained in:
martin 2019-09-26 17:14:43 +00:00
parent 580c5a3a93
commit 8788f97e77

View File

@ -272,12 +272,13 @@ begin
// removing duplicates
for i := 0 to fItems.Count - 1 do begin
trace := TStackTrace(fItems[i]);
if trace = nil then
continue;
s := GetHashString(trace);
hashed := TStackTrace(hash.Items[s]);
if Assigned(hashed) then begin
inc(hashed.LeakCount);
trace.Free; // remove from list
fItems[i] := nil;
fItems[i] := nil; // this call destroy on the old trace object
end else
hash.Add(s, trace)
end;
@ -304,8 +305,6 @@ procedure THeapTrcViewForm.ClearItems;
var
i : integer;
begin
for i := 0 to fItems.Count - 1 do
TObject(fItems[i]).Free;
fItems.Clear;
end;