forked from qt-creator/qt-creator
HelloWorld: Do not use global object pool anymore
Change-Id: Ief4b53475fbe87f30b8305cf07dc14a5819e4662 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user