CMake: Do not crash when deleting cmake tools

Do not crash when the cmake tool that was used to parse the project
gets removed.

Change-Id: Ieda3ae2025dbcfb1f90d9bd01c5f0ed960756c6a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Tobias Hunger
2018-05-24 16:57:31 +02:00
parent b48742ad40
commit 88b065db3f
8 changed files with 45 additions and 28 deletions

View File

@@ -41,8 +41,9 @@ namespace Internal {
BuildDirReader *BuildDirReader::createReader(const BuildDirParameters &p)
{
QTC_ASSERT(p.isValid() && p.cmakeTool, return nullptr);
if (p.cmakeTool->hasServerMode())
CMakeTool *cmake = p.cmakeTool();
QTC_ASSERT(p.isValid() && cmake, return nullptr);
if (cmake->hasServerMode())
return new ServerModeReader;
return new TeaLeafReader;
}