EDITOR - crash when issuing undo command after the table subview is closed
How to create:
- open referenceables table subview
- make a change (e.g. NPC Name)
- close the table subview
- undo
CSVWorld::Table calls setModel() using a pointer to IdTableProxyModel. This is then used by Qt later when an item is modified. QAbstractItemView::commitData() calls delegate->setModelData(editor, d->model, index) where d->model is the pointer earlier set. ModifyCommand eventually saves the model during construction in mModel. mModel is used by undo() later. However CSVWorld::Table and the pointer to IdTableProxyModel are destroyed when the subview is closed.
Partial call stack when ModifyCommand is set:
openmw-cs.exe!CSMWorld::ModifyCommand::ModifyCommand() openmw-cs.exe!CSVWorld::CommandDelegate::setModelDataImp() openmw-cs.exe!CSVWorld::CommandDelegate::setModelData() QtGuid4.dll!QAbstractItemView::commitData()
(RM-2498 from redmine: created on 2015-04-21 by cc 9cii, , closed on 2015-04-23 by Marc Zinnschlag)