LCL/DBGrid: Fix memory leak, patch by michalgw, issue #39904.

(cherry picked from commit e21bc4cd01)
This commit is contained in:
wp_xyz 2022-09-15 23:42:57 +02:00 committed by Maxim Ganetsky
parent 5fce24b919
commit 302a29d51a

View File

@ -4637,7 +4637,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;