diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 4560e77e88..1c56df5fb5 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -4630,7 +4630,12 @@ begin FList.Insert(Index, Bookmark); FGrid.Invalidate; end else + begin FDataset.FreeBookmark(Bookmark); + {$ifndef noautomatedbookmark} + SetLength(TBookmark(Bookmark),0); // decrease reference count + {$endif} + end; end; end;