mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 11:16:09 +02:00
fix memleak in TLazSearchResultTV.BeginUpdate
reported by Martin Friebe Fixes: http://bugs.freepascal.org/view.php?id=12592 git-svn-id: trunk@17292 -
This commit is contained in:
parent
317311310b
commit
f2ce94e3a9
@ -634,7 +634,7 @@ begin
|
|||||||
if CurrentTV.UpdateState then
|
if CurrentTV.UpdateState then
|
||||||
result:= CurrentTV.UpdateItems
|
result:= CurrentTV.UpdateItems
|
||||||
else
|
else
|
||||||
result:= CurrentTV.ItemsAsStrings;
|
Result := CurrentTV.ItemsAsStrings;
|
||||||
end;//if
|
end;//if
|
||||||
end;//GetItems
|
end;//GetItems
|
||||||
|
|
||||||
@ -1092,12 +1092,18 @@ begin
|
|||||||
end;//Destroy
|
end;//Destroy
|
||||||
|
|
||||||
procedure TLazSearchResultTV.BeginUpdate;
|
procedure TLazSearchResultTV.BeginUpdate;
|
||||||
|
var
|
||||||
|
s: TStrings;
|
||||||
begin
|
begin
|
||||||
inc(fUpdateCount);
|
inc(fUpdateCount);
|
||||||
if (fUpdateCount = 1) then
|
if (fUpdateCount = 1) then
|
||||||
begin
|
begin
|
||||||
if Assigned(Items) then
|
if Assigned(Items) then
|
||||||
fUpdateStrings.Assign(ItemsAsStrings);
|
begin
|
||||||
|
s := ItemsAsStrings;
|
||||||
|
fUpdateStrings.Assign(s);
|
||||||
|
s.Free;
|
||||||
|
end;
|
||||||
fUpdating:= true;
|
fUpdating:= true;
|
||||||
end;//if
|
end;//if
|
||||||
end;//BeginUpdate
|
end;//BeginUpdate
|
||||||
|
Loading…
Reference in New Issue
Block a user