mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-23 11:39:09 +02:00
LCL, fix AV while doing dbgrid.selectedRows.delete (and memleak under 2.6.4), issue #26913
git-svn-id: trunk@46637 -
This commit is contained in:
parent
30ba201a13
commit
9d659a9b1f
@ -4235,13 +4235,15 @@ begin
|
|||||||
{$ifdef dbgDBGrid}
|
{$ifdef dbgDBGrid}
|
||||||
DebugLn('%s.Delete', [ClassName]);
|
DebugLn('%s.Delete', [ClassName]);
|
||||||
{$endif}
|
{$endif}
|
||||||
for i := 0 to FList.Count - 1 do begin
|
for i := FList.Count-1 downto 0 do begin
|
||||||
FDataset.GotoBookmark(Items[i]);
|
FDataset.GotoBookmark(Items[i]);
|
||||||
FDataset.Delete;
|
|
||||||
{$ifndef noautomatedbookmark}
|
{$ifndef noautomatedbookmark}
|
||||||
Bookmark := FList[i];
|
Bookmark := FList[i];
|
||||||
SetLength(TBookmark(Bookmark),0); // decrease reference count
|
SetLength(TBookmark(Bookmark),0); // decrease reference count
|
||||||
|
{$else}
|
||||||
|
FDataset.FreeBookmark(Items[i]);
|
||||||
{$endif noautomatedbookmark}
|
{$endif noautomatedbookmark}
|
||||||
|
FDataset.Delete;
|
||||||
FList.Delete(i);
|
FList.Delete(i);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user