HelloWorld: Do not use global object pool anymore

Change-Id: Ief4b53475fbe87f30b8305cf07dc14a5819e4662
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2018-01-26 17:41:49 +01:00
parent e783f883ea
commit 22742b15e7
2 changed files with 7 additions and 4 deletions

View File

@@ -75,6 +75,7 @@ HelloWorldPlugin::HelloWorldPlugin()
*/ */
HelloWorldPlugin::~HelloWorldPlugin() HelloWorldPlugin::~HelloWorldPlugin()
{ {
delete m_helloMode;
} }
/*! Initializes the plugin. Returns true on success. /*! Initializes the plugin. Returns true on success.
@@ -116,10 +117,8 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMe
Core::ActionManager::actionContainer(Core::Constants::M_TOOLS); Core::ActionManager::actionContainer(Core::Constants::M_TOOLS);
toolsMenu->addMenu(helloWorldMenu); toolsMenu->addMenu(helloWorldMenu);
// Add a mode with a push button based on BaseMode. Like the BaseView, // Add a mode with a push button based on BaseMode.
// it will unregister itself from the plugin manager when it is deleted. m_helloMode = new HelloMode;
Core::IMode *helloMode = new HelloMode;
addAutoReleasedObject(helloMode);
return true; return true;
} }

View File

@@ -30,6 +30,8 @@
namespace HelloWorld { namespace HelloWorld {
namespace Internal { namespace Internal {
class HelloMode;
class HelloWorldPlugin class HelloWorldPlugin
: public ExtensionSystem::IPlugin : public ExtensionSystem::IPlugin
{ {
@@ -46,6 +48,8 @@ public:
private: private:
void sayHelloWorld(); void sayHelloWorld();
HelloMode *m_helloMode = nullptr;
}; };
} // namespace Internal } // namespace Internal