From de9c2d3bf044dd17a3b490ac0d34add24d4f335d Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Fri, 2 Dec 2016 09:50:14 +0100 Subject: [PATCH] Fix potential startup crashes Change-Id: Id0f03b4fa9ff6a8f0f5b0de11fe51c3729065140 Reviewed-by: Tobias Hunger --- src/plugins/coreplugin/find/findplugin.cpp | 14 ++++++++------ 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 0b3eb6962b3..7fa23ddebd4 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 fb4f32c01d2..ac67ba9ea31 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 > m_recentProjects; // pair of filename, displayname static const int m_maxRecentProjects = 25;