forked from qt-creator/qt-creator
CMake: fix crash on project close during active file system scanning
TreeScanner uses callbacks that can refers to the destroyed objectes when project closing. Found scenario: 1. Open big CMake-based project (CLang/LLVM good choose). 2. Until file system scanning finished switch to another session. Change-Id: Ia0f55f38aea6a9d07ca81aee6c9e9c5662d74f3a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Tobias Hunger
parent
336adaa604
commit
bc46ba11ee
@@ -128,6 +128,11 @@ CMakeProject::CMakeProject(CMakeManager *manager, const FileName &fileName)
|
||||
|
||||
CMakeProject::~CMakeProject()
|
||||
{
|
||||
if (!m_treeScanner.isFinished()) {
|
||||
auto future = m_treeScanner.future();
|
||||
future.cancel();
|
||||
future.waitForFinished();
|
||||
}
|
||||
setRootProjectNode(nullptr);
|
||||
m_codeModelFuture.cancel();
|
||||
qDeleteAll(m_extraCompilers);
|
||||
|
||||
Reference in New Issue
Block a user