From cbe503a9044effbaa7c8d1ad6549d4301536eab8 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 30 Jul 2024 18:01:47 +0200 Subject: [PATCH] BinEditor: Don't register editor factory in global object pool Only the service factory is needed. Change-Id: I40840d6948075f8656eb0cf7113fcc6b95b8f037 Reviewed-by: Eike Ziller --- src/plugins/bineditor/bineditorplugin.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 87c9fc2fa7e..61d4c75205b 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -2352,7 +2352,7 @@ static BinEditorFactoryService &binEditorService() ///////////////////////////////// BinEditorFactory ////////////////////////////////// -class BinEditorFactory final : public QObject, public IEditorFactory +class BinEditorFactory final : public IEditorFactory { public: BinEditorFactory() @@ -2367,13 +2367,11 @@ public: } }; -static BinEditorFactory &binEditorFactory() +void setupBinEditor() { static BinEditorFactory theBinEditorFactory; - return theBinEditorFactory; } - ///////////////////////////////// BinEditorPlugin ////////////////////////////////// class BinEditorPlugin final : public ExtensionSystem::IPlugin @@ -2384,13 +2382,12 @@ class BinEditorPlugin final : public ExtensionSystem::IPlugin ~BinEditorPlugin() final { ExtensionSystem::PluginManager::removeObject(&binEditorService()); - ExtensionSystem::PluginManager::removeObject(&binEditorFactory()); } void initialize() final { + setupBinEditor(); ExtensionSystem::PluginManager::addObject(&binEditorService()); - ExtensionSystem::PluginManager::addObject(&binEditorFactory()); } };