Skip to content
Snippets Groups Projects
Unverified Commit 0b93892d authored by Walter Van Herck's avatar Walter Van Herck Committed by GitHub
Browse files

Merge pull request #653 from gpospelov/release-1.13.0

Check against destroyed model in 3D view
parents 43256fdb 6149ee42
No related branches found
No related tags found
No related merge requests found
......@@ -128,6 +128,8 @@ void RealSpaceCanvas::onChangeLayerSizeAction(double layerSizeChangeScale)
void RealSpaceCanvas::onDataChanged(const QModelIndex& index)
{
auto item = m_sampleModel->itemForIndex(index);
if (!item)
return;
if (!(item->modelType() == Constants::PropertyType
&& (item->displayName() == SessionGraphicsItem::P_XPOS
......@@ -137,6 +139,9 @@ void RealSpaceCanvas::onDataChanged(const QModelIndex& index)
void RealSpaceCanvas::updateScene()
{
if (!m_currentSelection.isValid())
return;
QApplication::setOverrideCursor(Qt::WaitCursor);
m_realSpaceModel.reset(new RealSpaceModel);
......@@ -215,6 +220,9 @@ void RealSpaceCanvas::setConnected(SampleModel* model, bool makeConnected)
Qt::UniqueConnection);
connect(model, &SampleModel::modelReset, this, &RealSpaceCanvas::resetScene,
Qt::UniqueConnection);
connect(model, &SampleModel::modelAboutToBeReset, this, [&](){ m_currentSelection = QModelIndex();},
Qt::UniqueConnection);
} else {
disconnect(model, &SampleModel::rowsInserted, this, &RealSpaceCanvas::updateScene);
disconnect(model, &SampleModel::rowsRemoved, this, &RealSpaceCanvas::updateScene);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment