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:
jesus 2014-10-22 01:05:09 +00:00
parent 30ba201a13
commit 9d659a9b1f

View File

@ -4235,13 +4235,15 @@ begin
{$ifdef dbgDBGrid}
DebugLn('%s.Delete', [ClassName]);
{$endif}
for i := 0 to FList.Count - 1 do begin
for i := FList.Count-1 downto 0 do begin
FDataset.GotoBookmark(Items[i]);
FDataset.Delete;
{$ifndef noautomatedbookmark}
Bookmark := FList[i];
SetLength(TBookmark(Bookmark),0); // decrease reference count
{$else}
FDataset.FreeBookmark(Items[i]);
{$endif noautomatedbookmark}
FDataset.Delete;
FList.Delete(i);
end;
end;