From ece34a1baa2c963d7f5429126c75891c0addd1b4 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 30 Mar 2015 18:14:07 +1100 Subject: [PATCH] Workaround for crash while exiting the application. --- apps/opencs/model/world/idtable.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index c5061b93d..1c21e64c3 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -14,7 +14,9 @@ CSMWorld::IdTable::IdTable (CollectionBase *idCollection, unsigned int features) {} CSMWorld::IdTable::~IdTable() -{} +{ + mIdCollection = 0; // FIXME: workaround only, should stop QHideEvent calling after destruction +} int CSMWorld::IdTable::rowCount (const QModelIndex & parent) const { @@ -81,6 +83,10 @@ QVariant CSMWorld::IdTable::headerData (int section, QVariant CSMWorld::IdTable::nestedHeaderData(int section, int subSection, Qt::Orientation orientation, int role) const { + // FIXME: workaround only, should stop QHideEvent calling after destruction + if (section < 0 || !mIdCollection || section >= mIdCollection->getColumns()) + return QVariant(); + const NestColumn& parentColumn = dynamic_cast(mIdCollection->getColumn(section)); if (orientation==Qt::Vertical)