From 429163ea1e5af2a46b76d30a93a695ee46022c2d Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Mon, 10 Jul 2017 19:10:37 +0200 Subject: [PATCH] Qmljs: fix a crash when m_treeview is deleted Change-Id: I3743815c14151b49784a20cdb0c0bba2fbde4e7b Reviewed-by: Marco Benelli Reviewed-by: Eike Ziller --- src/plugins/qmljseditor/qmljsoutline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp index 9cd3e78eae6..435725c0b27 100644 --- a/src/plugins/qmljseditor/qmljsoutline.cpp +++ b/src/plugins/qmljseditor/qmljsoutline.cpp @@ -125,12 +125,12 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor) m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel()); m_treeView->expandAll(); - connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, [this]() { - if (m_treeView && m_treeView->selectionModel()) + connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, m_treeView, [this]() { + if (m_treeView->selectionModel()) m_treeView->selectionModel()->blockSignals(true); }); - connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, [this]() { - if (m_treeView && m_treeView->selectionModel()) + connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, m_treeView, [this]() { + if (m_treeView->selectionModel()) m_treeView->selectionModel()->blockSignals(false); });