From c0efa0e93f8c3b11b0ea102e973077c714740702 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Thu, 15 Sep 2022 23:42:57 +0200 Subject: [PATCH] LCL/DBGrid: Fix memory leak, patch by michalgw, issue #39904. --- lcl/dbgrids.pas | 5 +++++ 1 file changed, 5 insertions(+) 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;