Fix crash when exiting via window manager on some systems.

test
cc9cii 10 years ago
parent 9a564f5062
commit 7990fab708

@ -54,8 +54,7 @@ QVariant CSMWorld::IdTree::data (const QModelIndex & index, int role) const
QVariant CSMWorld::IdTree::nestedHeaderData(int section, int subSection, Qt::Orientation orientation, int role) const
{
// FIXME: workaround only, a proper fix should stop QHideEvent calls after destruction
if (section < 0 || !idCollection() || section >= idCollection()->getColumns())
if (section < 0 || section >= idCollection()->getColumns())
return QVariant();
const NestableColumn *parentColumn = mNestedCollection->getNestableColumn(section);

@ -61,7 +61,6 @@ namespace CSMWorld
virtual QModelIndex parent (const QModelIndex& index) const;
// TODO: check if below methods are really needed
QVariant nestedHeaderData(int section, int subSection, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
NestedTableWrapperBase* nestedTable(const QModelIndex &index) const;

@ -32,6 +32,10 @@ void CSVDoc::View::closeEvent (QCloseEvent *event)
event->ignore();
else
{
// delete the subviews first
for (QList<CSVDoc::SubView *>::iterator iter = mSubViews.begin(); iter != mSubViews.end(); ++iter)
delete *iter;
// closeRequest() returns true if last document
mViewManager.removeDocAndView(mDocument);
}

Loading…
Cancel
Save