Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ PdmUiTreeSelectionEditor::PdmUiTreeSelectionEditor()
//--------------------------------------------------------------------------------------------------
PdmUiTreeSelectionEditor::~PdmUiTreeSelectionEditor()
{
// The tree view is deleted using deleteLater() in ~PdmUiFieldEditorHandle, while m_model and m_proxyModel are
// children of this editor and are deleted immediately. Detach the view from the models, otherwise pending events
// in the view (e.g. deferred QHeaderView::reset) may operate on a selection model whose model has been destroyed,
// causing "QItemSelectionModel: Selecting when no model has been set will result in a no-op."
// https://github.com/OPM/ResInsight/issues/10988
if ( m_treeView ) m_treeView->setModel( nullptr );
}

//--------------------------------------------------------------------------------------------------
Expand Down