diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2016-12-02 09:50:14 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2016-12-02 09:03:01 +0000 |
commit | de9c2d3bf044dd17a3b490ac0d34add24d4f335d (patch) | |
tree | 546720d4f63d50daa623b02046707c2057f66195 | |
parent | e2eb591c4c15ff706ff7162a71a8f1cc1f0c01bb (diff) | |
download | qt-creator-de9c2d3bf044dd17a3b490ac0d34add24d4f335d.tar.gz |
Fix potential startup crashes
Change-Id: Id0f03b4fa9ff6a8f0f5b0de11fe51c3729065140
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r-- | src/plugins/coreplugin/find/findplugin.cpp | 14 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/coreplugin/find/findplugin.cpp b/src/plugins/coreplugin/find/findplugin.cpp index 0b3eb6962b..7fa23ddebd 100644 --- a/src/plugins/coreplugin/find/findplugin.cpp +++ b/src/plugins/coreplugin/find/findplugin.cpp @@ -106,12 +106,14 @@ void Find::destroy() { delete m_instance; m_instance = 0; - delete d->m_currentDocumentFind; - delete d->m_findToolBar; - delete d->m_findDialog; - ExtensionSystem::PluginManager::removeObject(d->m_searchResultWindow); - delete d->m_searchResultWindow; - delete d; + if (d) { + delete d->m_currentDocumentFind; + delete d->m_findToolBar; + delete d->m_findDialog; + ExtensionSystem::PluginManager::removeObject(d->m_searchResultWindow); + delete d->m_searchResultWindow; + delete d; + } } Find *Find::instance() diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index fb4f32c01d..ac67ba9ea3 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -331,11 +331,11 @@ public: QAction *m_projectSelectorActionQuick; QAction *m_runSubProject; - ProjectWindow *m_proWindow; + ProjectWindow *m_proWindow = nullptr; QString m_sessionToRestoreAtStartup; QStringList m_profileMimeTypes; - AppOutputPane *m_outputPane; + AppOutputPane *m_outputPane = nullptr; QList<QPair<QString, QString> > m_recentProjects; // pair of filename, displayname static const int m_maxRecentProjects = 25; |