mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
#14279 Guard line editor editing-finished against deleted field
This commit is contained in:
@@ -350,6 +350,11 @@ QMargins PdmUiLineEditor::calculateLabelContentMargins() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiLineEditor::slotEditingFinished()
|
||||
{
|
||||
// The field may have been destroyed (e.g. its owning object was deleted) while the editor still
|
||||
// had focus. Hiding the editor during teardown emits editingFinished, so guard against the now
|
||||
// null field before committing. PdmUiItem::~PdmUiItem() clears the editor's item pointer.
|
||||
if ( !uiField() ) return;
|
||||
|
||||
QVariant v;
|
||||
|
||||
uiField()->enableAutoValue( false );
|
||||
|
||||
Reference in New Issue
Block a user