forked from qt-creator/qt-creator
QmakeProjectManager: Make sure we reset the ProFileCacheManager
Otherwise, we can get an assertion when exiting during a parse. Change-Id: I3a2a1fbb854662b77b2e1485a9097b9f39d94fe2 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -238,6 +238,10 @@ QmakeBuildSystem::~QmakeBuildSystem()
|
|||||||
|
|
||||||
// Make sure root node (and associated readers) are shut hown before proceeding
|
// Make sure root node (and associated readers) are shut hown before proceeding
|
||||||
m_rootProFile.reset();
|
m_rootProFile.reset();
|
||||||
|
if (m_qmakeGlobalsRefCnt > 0) {
|
||||||
|
m_qmakeGlobalsRefCnt = 0;
|
||||||
|
deregisterFromCacheManager();
|
||||||
|
}
|
||||||
|
|
||||||
m_cancelEvaluate = true;
|
m_cancelEvaluate = true;
|
||||||
QTC_CHECK(m_qmakeGlobalsRefCnt == 0);
|
QTC_CHECK(m_qmakeGlobalsRefCnt == 0);
|
||||||
@@ -733,16 +737,21 @@ void QmakeBuildSystem::destroyProFileReader(QtSupport::ProFileReader *reader)
|
|||||||
[reader] { delete reader; });
|
[reader] { delete reader; });
|
||||||
onFinished(deleteFuture, this, [this](const QFuture<void> &) {
|
onFinished(deleteFuture, this, [this](const QFuture<void> &) {
|
||||||
if (!--m_qmakeGlobalsRefCnt) {
|
if (!--m_qmakeGlobalsRefCnt) {
|
||||||
QString dir = projectFilePath().toString();
|
deregisterFromCacheManager();
|
||||||
if (!dir.endsWith(QLatin1Char('/')))
|
|
||||||
dir += QLatin1Char('/');
|
|
||||||
QtSupport::ProFileCacheManager::instance()->discardFiles(dir, qmakeVfs());
|
|
||||||
QtSupport::ProFileCacheManager::instance()->decRefCount();
|
|
||||||
m_qmakeGlobals.reset();
|
m_qmakeGlobals.reset();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmakeBuildSystem::deregisterFromCacheManager()
|
||||||
|
{
|
||||||
|
QString dir = projectFilePath().toString();
|
||||||
|
if (!dir.endsWith(QLatin1Char('/')))
|
||||||
|
dir += QLatin1Char('/');
|
||||||
|
QtSupport::ProFileCacheManager::instance()->discardFiles(dir, qmakeVfs());
|
||||||
|
QtSupport::ProFileCacheManager::instance()->decRefCount();
|
||||||
|
}
|
||||||
|
|
||||||
void QmakeBuildSystem::activeTargetWasChanged(Target *t)
|
void QmakeBuildSystem::activeTargetWasChanged(Target *t)
|
||||||
{
|
{
|
||||||
// We are only interested in our own target.
|
// We are only interested in our own target.
|
||||||
|
@@ -139,6 +139,7 @@ public:
|
|||||||
QString qmakeSysroot();
|
QString qmakeSysroot();
|
||||||
/// \internal
|
/// \internal
|
||||||
void destroyProFileReader(QtSupport::ProFileReader *reader);
|
void destroyProFileReader(QtSupport::ProFileReader *reader);
|
||||||
|
void deregisterFromCacheManager();
|
||||||
|
|
||||||
/// \internal
|
/// \internal
|
||||||
void scheduleAsyncUpdateFile(QmakeProFile *file,
|
void scheduleAsyncUpdateFile(QmakeProFile *file,
|
||||||
|
Reference in New Issue
Block a user