forked from qt-creator/qt-creator
QtSupport: Don't rely on QObject parents on late destruction
Change-Id: Ibdb91c80d4932a5f0dced9843dfd01641577a88d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -135,6 +135,12 @@ void QtSupportPlugin::initialize()
|
||||
QtVersionManager::initialized();
|
||||
}
|
||||
|
||||
ExtensionSystem::IPlugin::ShutdownFlag QtSupportPlugin::aboutToShutdown()
|
||||
{
|
||||
QtVersionManager::shutdown();
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
|
||||
const char kLinkWithQtInstallationSetting[] = "LinkWithQtInstallation";
|
||||
|
||||
static void askAboutQtInstallation()
|
||||
|
@@ -19,6 +19,7 @@ public:
|
||||
private:
|
||||
void initialize() final;
|
||||
void extensionsInitialized() final;
|
||||
ShutdownFlag aboutToShutdown() final;
|
||||
|
||||
class QtSupportPluginPrivate *d = nullptr;
|
||||
|
||||
|
@@ -92,9 +92,12 @@ public:
|
||||
this, &QtVersionManagerImpl::triggerQtVersionRestore);
|
||||
}
|
||||
|
||||
~QtVersionManagerImpl()
|
||||
void shutdown()
|
||||
{
|
||||
delete m_writer;
|
||||
m_writer = nullptr;
|
||||
delete m_configFileWatcher;
|
||||
m_configFileWatcher = nullptr;
|
||||
qDeleteAll(m_versions);
|
||||
m_versions.clear();
|
||||
}
|
||||
@@ -174,6 +177,11 @@ void QtVersionManager::initialized()
|
||||
qtVersionManagerImpl();
|
||||
}
|
||||
|
||||
void QtVersionManager::shutdown()
|
||||
{
|
||||
qtVersionManagerImpl().shutdown();
|
||||
}
|
||||
|
||||
bool QtVersionManagerImpl::restoreQtVersions()
|
||||
{
|
||||
QTC_ASSERT(!m_writer, return false);
|
||||
|
@@ -45,6 +45,8 @@ public:
|
||||
const QString &manifestPath,
|
||||
const QString &examplesPath);
|
||||
|
||||
static void shutdown();
|
||||
|
||||
signals:
|
||||
// content of QtVersion objects with qmake path might have changed
|
||||
void qtVersionsChanged(const QList<int> &addedIds, const QList<int> &removedIds, const QList<int> &changedIds);
|
||||
|
Reference in New Issue
Block a user