QmlDesigner: Fix crash on exit

Change-Id: I26f3c1154d8cdef9cf76b6f608634067b099ea0e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Marco Bubke
2024-05-14 15:41:50 +02:00
parent c2778b2301
commit bfbcf88161

View File

@@ -740,7 +740,8 @@ void MaterialEditorView::modelAboutToBeDetached(Model *model)
{
AbstractView::modelAboutToBeDetached(model);
m_dynamicPropertiesModel->reset();
m_qmlBackEnd->materialEditorTransaction()->end();
if (auto transaction = m_qmlBackEnd->materialEditorTransaction())
transaction->end();
m_qmlBackEnd->contextObject()->setHasMaterialLibrary(false);
m_selectedMaterial = {};
}