CMakePM: Fix removing cmake tools

The id might be destroyed with its parent before trying to
reference it again and put it into the list.

Change-Id: Ic7bb053293b24f0f0109a1c6479f73b7cbec2dc0
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-09-03 11:23:59 +02:00
parent f849319d11
commit f9600b7335

View File

@@ -343,8 +343,8 @@ void CMakeToolItemModel::removeCMakeTool(const Utils::Id &id)
CMakeToolTreeItem *treeItem = cmakeToolItem(id); CMakeToolTreeItem *treeItem = cmakeToolItem(id);
QTC_ASSERT(treeItem, return); QTC_ASSERT(treeItem, return);
destroyItem(treeItem);
m_removedItems.append(id); m_removedItems.append(id);
destroyItem(treeItem);
} }
void CMakeToolItemModel::apply() void CMakeToolItemModel::apply()