TADVStringGrid Exception at destroy


In our programm the TADVStringGrids is heavy used, with Filters, Colours, Checkboxes, Hidecolumns and ....
It is often rebuild, first we try to clean the ADVStringGrid but there was many exception, so we decide to destroy it and rebuild it every time. But still it comes to exceptions (not ooften but 2 times a day). We can avoid some exception with

grd_importe.FilterActive := False;
//DisableEventsGrid; DFI 05.07.2023 rückgängig
FreeAndNil(grd_importe); But there are still exceptions

|00A0BC02|AdvGrid.pas |AdvGrid |TAdvStringGrid |GetCellGraphic |25101[5] |
|00A0BA42|AdvGrid.pas |AdvGrid |TAdvStringGrid |FreeCellGraphic |25035[3] |
|00A3CD1D|AdvGrid.pas |AdvGrid |TAdvStringGrid |ClearRect |46040[24] |
|00A3CE1D|AdvGrid.pas |AdvGrid |TAdvStringGrid |ClearRect |46068[52] |
|009EED2B|AdvGrid.pas |AdvGrid |TAdvStringGrid |Destroy |13014[45] |
|00051175|EMemLeaks.pas |EMemLeaks | |VerifyFreedObject |3694[29] |
|0000AD78|System.pas |System |TObject |Free | |
|001407CE|System.Classes.pas |System.Classes |TComponent |DestroyComponents | |
|001407CE|{38E0C963-48A9-4649-A681-F4F0B4371047}|recursive |area |removed |10[0] |
|00140267|System.Classes.pas |System.Classes |TComponent |Destroy | |
|002A5435|Vcl.Controls.pas |Vcl.Controls |TControl |Destroy | | |0012934F|System.Classes.pas |System.Classes |TPersistent |Destroy | |
|0000AD78|System.pas |System |TObject |Free | |
|002A9D49|Vcl.Controls.pas |Vcl.Controls |TWinControl |Destroy | |
|003C4A23|Vcl.Forms.pas |Vcl.Forms |TScrollingWinControl|Destroy | |
|003C5D78|Vcl.Forms.pas |Vcl.Forms |TCustomForm |Destroy | |
|0000AD78|System.pas |System |TObject |Free |

The Grid Version is
Delphi is 10.3 Version 26.0.36039.7899

The programm is huge and the exceptions come not regulary so i can not give a code snippet.
Do you have any ideas what can i do to fix the problem ?

Dirk Fischer


first we try to clean the ADVStringGrid but there was many exception

How exactly are you trying to "clean" it?


We try many things like advgrid.removerows(1,Rowcount-1)

But nothing works perfectly.
The problem is that this exceptions appear not often, so i have no chance to debug this problem.
In the moment destroy and create is the best solution but when the exception occurs you can not use the pramm anymore and you have to restart everything.
Maybe i should remove all checkboxes in the grid (because the error is in GetCellGraphics) and i thinks we not use pictures in the Grid?
I thinke at RemoveRows also occurs to an exceptions sometimes


Dirk Fischer