diff --git a/src/plugins/scxmleditor/scxmleditordata.cpp b/src/plugins/scxmleditor/scxmleditordata.cpp index 394b00533c3..14d9c26e18b 100644 --- a/src/plugins/scxmleditor/scxmleditordata.cpp +++ b/src/plugins/scxmleditor/scxmleditordata.cpp @@ -87,8 +87,7 @@ public: } }; -ScxmlEditorData::ScxmlEditorData(QObject *parent) - : QObject(parent) +ScxmlEditorData::ScxmlEditorData() { m_contexts.add(ScxmlEditor::Constants::C_SCXMLEDITOR); diff --git a/src/plugins/scxmleditor/scxmleditordata.h b/src/plugins/scxmleditor/scxmleditordata.h index 25054ecb3ab..0cd4bf71192 100644 --- a/src/plugins/scxmleditor/scxmleditordata.h +++ b/src/plugins/scxmleditor/scxmleditordata.h @@ -46,7 +46,7 @@ class ScxmlEditorData : public QObject { Q_OBJECT public: - ScxmlEditorData(QObject *parent = nullptr); + ScxmlEditorData(); ~ScxmlEditorData() override; void fullInit(); diff --git a/src/plugins/scxmleditor/scxmleditorfactory.cpp b/src/plugins/scxmleditor/scxmleditorfactory.cpp index a18132f9846..56d707173e8 100644 --- a/src/plugins/scxmleditor/scxmleditorfactory.cpp +++ b/src/plugins/scxmleditor/scxmleditorfactory.cpp @@ -48,7 +48,7 @@ ScxmlEditorFactory::ScxmlEditorFactory() setEditorCreator([this] { if (!m_editorData) { - m_editorData = new ScxmlEditorData(this); + m_editorData = new ScxmlEditorData; QGuiApplication::setOverrideCursor(Qt::WaitCursor); m_editorData->fullInit(); QGuiApplication::restoreOverrideCursor(); @@ -56,3 +56,8 @@ ScxmlEditorFactory::ScxmlEditorFactory() return m_editorData->createEditor(); }); } + +ScxmlEditorFactory::~ScxmlEditorFactory() +{ + delete m_editorData; +} diff --git a/src/plugins/scxmleditor/scxmleditorfactory.h b/src/plugins/scxmleditor/scxmleditorfactory.h index f4424f613c7..7dd3393da5f 100644 --- a/src/plugins/scxmleditor/scxmleditorfactory.h +++ b/src/plugins/scxmleditor/scxmleditorfactory.h @@ -36,6 +36,7 @@ class ScxmlEditorFactory final : public Core::IEditorFactory { public: ScxmlEditorFactory(); + ~ScxmlEditorFactory(); private: ScxmlEditorData* m_editorData = nullptr;