mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
#14279 Guard line editor editing-finished against deleted field
This commit is contained in:
1 parent
203cf83334
commit
d7d3938986
1 file changed
+5
@@ -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