dw_elliott:
rowP = mdlListModel_getRowAtIndex (listP, i);
mdlListRow_destroy (rowP);
mdlDialog_listBoxNRowsChangedRedraw (diP->rawItemP, TRUE);
If you are stepping through the list starting at zero, deleting a row, then incrementing the index, then you run the risk of attempting to delete rows that no longer exist. Prefer to step backwards through the ListModel, so your index remains valid throughout the process.
dw_elliott:
I have a ListBoxRsc which contains a ListModel
You haven't. What you have is a ListBoxRsc that describes a ListBox. At design-time there is no way to specify whether the ListBox will display a StringList or a ListModel.
Presumably you have assigned a hook function to that ListBoxRsc. The hook function assigns your ListModel to the ListBox at run-time, in the _CREATE event.