mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-01 03:37:15 -06:00
Fix crash seen when deleting a 3D view part of a linked view collection
This commit is contained in:
parent
5a56a285a0
commit
b108cdb72d
@ -65,6 +65,9 @@ void RicDeleteItemExec::redo()
|
||||
m_commandData.m_deletedObjectAsXml = xmlObj( obj )->writeObjectToXmlString();
|
||||
}
|
||||
|
||||
// Make sure the object is disconnected from other objects before delete
|
||||
obj->prepareForDelete();
|
||||
|
||||
delete obj;
|
||||
|
||||
listField->erase( m_commandData.m_indexToObject );
|
||||
|
@ -151,7 +151,15 @@ void PdmUiPropertyView::showProperties( PdmObjectHandle* object )
|
||||
{
|
||||
if ( object )
|
||||
{
|
||||
PdmUiObjectHandle* uiObject1 = uiObj( m_defaultObjectEditor->pdmObject() );
|
||||
// Avoid using uiObj( m_defaultObjectEditor->pdmObject() ), as the ui capability can be removed by a
|
||||
// delete operation. See RicDeleteItemExec::redo() and use of obj->prepareForDelete()
|
||||
PdmUiObjectHandle* uiObject1 = m_defaultObjectEditor->pdmObject()->capability<PdmUiObjectHandle>();
|
||||
if ( !uiObject1 )
|
||||
{
|
||||
rebuildWidget = true;
|
||||
m_defaultObjectEditor->setPdmObject( nullptr );
|
||||
}
|
||||
|
||||
PdmUiObjectHandle* uiObject2 = uiObj( object );
|
||||
|
||||
if ( uiObject1 && uiObject2 &&
|
||||
@ -192,7 +200,7 @@ void PdmUiPropertyView::showProperties( PdmObjectHandle* object )
|
||||
|
||||
m_defaultObjectEditor->updateUi( m_uiConfigName );
|
||||
m_scrollArea->updateGeometry();
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user