forked from qt-creator/qt-creator
		
	WelcomePage: fix memory leak
I use AutoReleased now. Change-Id: I4fd5d04115ea8d0a04d3e7f5c4e96a934b5ae134 Reviewed-on: http://codereview.qt-project.org/5712 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
		@@ -47,12 +47,6 @@
 | 
			
		||||
using namespace QtSupport;
 | 
			
		||||
using namespace QtSupport::Internal;
 | 
			
		||||
 | 
			
		||||
QtSupportPlugin::~QtSupportPlugin()
 | 
			
		||||
{
 | 
			
		||||
    removeObject(m_welcomePage);
 | 
			
		||||
    delete m_welcomePage;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMessage)
 | 
			
		||||
{
 | 
			
		||||
    Q_UNUSED(arguments);
 | 
			
		||||
@@ -65,12 +59,13 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
 | 
			
		||||
    addAutoReleasedObject(mgr);
 | 
			
		||||
    addAutoReleasedObject(new QtOptionsPage);
 | 
			
		||||
 | 
			
		||||
    m_welcomePage = new GettingStartedWelcomePage;
 | 
			
		||||
    addObject(m_welcomePage);
 | 
			
		||||
    GettingStartedWelcomePage *welcomePage;
 | 
			
		||||
    welcomePage = new GettingStartedWelcomePage;
 | 
			
		||||
    addAutoReleasedObject(welcomePage);
 | 
			
		||||
 | 
			
		||||
    m_welcomePage = new GettingStartedWelcomePage;
 | 
			
		||||
    m_welcomePage->setShowExamples(true);
 | 
			
		||||
    addObject(m_welcomePage);
 | 
			
		||||
    welcomePage = new GettingStartedWelcomePage;
 | 
			
		||||
    welcomePage->setShowExamples(true);
 | 
			
		||||
    addAutoReleasedObject(welcomePage);
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,6 @@ class QtSupportPlugin : public ExtensionSystem::IPlugin
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    ~QtSupportPlugin();
 | 
			
		||||
    bool initialize(const QStringList &arguments, QString *errorMessage);
 | 
			
		||||
    void extensionsInitialized();
 | 
			
		||||
 | 
			
		||||
@@ -56,8 +55,6 @@ private slots:
 | 
			
		||||
    void testQtOutputParser_data();
 | 
			
		||||
    void testQtOutputParser();
 | 
			
		||||
#endif
 | 
			
		||||
private:
 | 
			
		||||
    GettingStartedWelcomePage *m_welcomePage;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace Internal
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user