forked from qt-creator/qt-creator
Plugins: Fix nullptr access
Some plugins access their private "d" member in their destructor. If Plugin initialization failed, these might not have been created. This would lead to a crash. Change-Id: Ifd916daf90ebac9a8933dd5489ec1ac0a38254a0 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -788,6 +788,8 @@ ProjectExplorerPlugin::ProjectExplorerPlugin()
|
|||||||
|
|
||||||
ProjectExplorerPlugin::~ProjectExplorerPlugin()
|
ProjectExplorerPlugin::~ProjectExplorerPlugin()
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(dd, return);
|
||||||
|
|
||||||
delete dd->m_proWindow; // Needs access to the kit manager.
|
delete dd->m_proWindow; // Needs access to the kit manager.
|
||||||
JsonWizardFactory::destroyAllFactories();
|
JsonWizardFactory::destroyAllFactories();
|
||||||
|
|
||||||
|
@@ -100,6 +100,8 @@ public:
|
|||||||
|
|
||||||
QmlProjectPlugin::~QmlProjectPlugin()
|
QmlProjectPlugin::~QmlProjectPlugin()
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(d, return);
|
||||||
|
|
||||||
if (d->lastMessageBox)
|
if (d->lastMessageBox)
|
||||||
d->lastMessageBox->deleteLater();
|
d->lastMessageBox->deleteLater();
|
||||||
if (d->landingPage)
|
if (d->landingPage)
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <utils/futuresynchronizer.h>
|
#include <utils/futuresynchronizer.h>
|
||||||
#include <utils/macroexpander.h>
|
#include <utils/macroexpander.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ VcsPlugin::VcsPlugin()
|
|||||||
|
|
||||||
VcsPlugin::~VcsPlugin()
|
VcsPlugin::~VcsPlugin()
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(d, return);
|
||||||
d->m_synchronizer.waitForFinished();
|
d->m_synchronizer.waitForFinished();
|
||||||
VcsOutputWindow::destroy();
|
VcsOutputWindow::destroy();
|
||||||
m_instance = nullptr;
|
m_instance = nullptr;
|
||||||
|
Reference in New Issue
Block a user