mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 16:58:14 +02:00
LeakView: fix crash due to double free.
git-svn-id: trunk@61926 -
This commit is contained in:
parent
2ee62a6a50
commit
d98120d75f
@ -272,12 +272,13 @@ begin
|
|||||||
// removing duplicates
|
// removing duplicates
|
||||||
for i := 0 to fItems.Count - 1 do begin
|
for i := 0 to fItems.Count - 1 do begin
|
||||||
trace := TStackTrace(fItems[i]);
|
trace := TStackTrace(fItems[i]);
|
||||||
|
if trace = nil then
|
||||||
|
continue;
|
||||||
s := GetHashString(trace);
|
s := GetHashString(trace);
|
||||||
hashed := TStackTrace(hash.Items[s]);
|
hashed := TStackTrace(hash.Items[s]);
|
||||||
if Assigned(hashed) then begin
|
if Assigned(hashed) then begin
|
||||||
inc(hashed.LeakCount);
|
inc(hashed.LeakCount);
|
||||||
trace.Free; // remove from list
|
fItems[i] := nil; // this call destroy on the old trace object
|
||||||
fItems[i] := nil;
|
|
||||||
end else
|
end else
|
||||||
hash.Add(s, trace)
|
hash.Add(s, trace)
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user