Hi folks, looking for a second opinion.
TListView is a really useful component. However, its giving me some problems and I am surprised they are not mentioned in either the bug tracker or the forum. So, I wonder if I am doing something wrong ?
I use TListView in OwnerData mode and some end users of my app will have 20K entries in their TListView. I recently added the Multiselect mode and find it triggers a
Memory Leak. There is an attached project demonstrating this leak (and several other issues). You can choose to build in GTK2 GTK3, QT5 or Qt6 mode.
To test, choose gtk2, Qt5 or Qt6, compile and run the project as supplied, click to select one of the entries in the ListView and then close it all down. You will see a Heaptrc report.
I believe the leak originates in line #891 of WSComCtrls.pp in the class procedure TWSCustomListView.Upda]"]>BlockedltiSelList(const ALV: TCustomListView; AItem: TListItem; Add: Boolean);
in this line "FMultiSelList := TIntegerList.Create;"
However, there seems to be other issues I noted while putting the demo together.
Firstly, gtk2 makes a call to every data point in its range instead of just the visible ones (as OwnerData should). See the number bottom left of the demo screen. Ah, interesting, that as a bug report already, I logged it in 2022,
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39803Second, gtk2, Qt5 and Qt6 makes extra calls for data, unnecessarily, during mouseover events. No new data lines are exposed, why ask for more data ?
Third, GTK3 does not work at all in OwnerData mode, I need to log that.
Finally, if you give up on using OwnerData, better make sure you don't put too many lines into the TListView. Qt5 maxes out at around 500, on the other hand, Qt6 can handle 50,000 ! Big difference. There is a {$define OwnerData} if you want to pay with the demo in non-OwnerData mode.
I think that there are several bug reports here, or am I doing something silly ?
Note : I am currently traveling and don't have Windows or Mac hardware with me.
Davo