QmlDesigner: fix crash

Task-number: QDS-11300
Change-Id: I1fe6966445284e3e9ca5596d8f5ec866f37acc39
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tim Jenssen
2023-11-20 21:21:54 +01:00
parent 77678c7bce
commit 701d4b2146

View File

@@ -78,6 +78,10 @@ void TextEditorWidget::setTextEditor(
});
m_textEditor->editorWidget()->installEventFilter(this);
// do not call the eventfilter when the m_textEditor is gone
connect(m_textEditor->editorWidget(), &QObject::destroyed, this, [this](QObject *) {
m_textEditor->editorWidget()->removeEventFilter(this);
});
}
}