If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
I think wxListCtrl just stores this data and never does anything with them. If the ptrdata contains a pointer to a dynamically allocated memory (it can be just integer as well), the application programmer is responsible for freeing the memory when it makes sense.
If the lifetime of the objects stored in ptrdata matches the lifetime of listctrl items, I would just release the memory when the items are no longer needed (an item is deleted from wxListCtrl, wxListCtrl is destroyed...).
PB wrote: ↑Thu Mar 26, 2020 3:34 pm
I think wxListCtrl just stores this data and never does anything with them. If the ptrdata contains a pointer to a dynamically allocated memory (it can be just integer as well), the application programmer is responsible for freeing the memory when it makes sense.
If the lifetime of the objects stored in ptrdata matches the lifetime of listctrl items, I would just release the memory when the items are no longer needed (an item is deleted from wxListCtrl, wxListCtrl is destroyed...).