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()
{
delete m_helloMode;
}
/*! 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);
toolsMenu->addMenu(helloWorldMenu);
// Add a mode with a push button based on BaseMode. Like the BaseView,
// it will unregister itself from the plugin manager when it is deleted.
Core::IMode *helloMode = new HelloMode;
addAutoReleasedObject(helloMode);
// Add a mode with a push button based on BaseMode.
m_helloMode = new HelloMode;
return true;
}

View File

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