mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 04:26:17 +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
|
||||
result:= CurrentTV.UpdateItems
|
||||
else
|
||||
result:= CurrentTV.ItemsAsStrings;
|
||||
Result := CurrentTV.ItemsAsStrings;
|
||||
end;//if
|
||||
end;//GetItems
|
||||
|
||||
@ -1092,12 +1092,18 @@ begin
|
||||
end;//Destroy
|
||||
|
||||
procedure TLazSearchResultTV.BeginUpdate;
|
||||
var
|
||||
s: TStrings;
|
||||
begin
|
||||
inc(fUpdateCount);
|
||||
if (fUpdateCount = 1) then
|
||||
begin
|
||||
if Assigned(Items) then
|
||||
fUpdateStrings.Assign(ItemsAsStrings);
|
||||
begin
|
||||
s := ItemsAsStrings;
|
||||
fUpdateStrings.Assign(s);
|
||||
s.Free;
|
||||
end;
|
||||
fUpdating:= true;
|
||||
end;//if
|
||||
end;//BeginUpdate
|
||||
|
Loading…
Reference in New Issue
Block a user