Debugger: Delete pointer if no more needed

Introduced with 2b19081cb0

Change-Id: I817ec48b9098f46ca703a6075d4657f0b7eb9948
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-06-15 15:40:22 +02:00
committed by hjk
parent d92055dde4
commit 90656ea455
2 changed files with 4 additions and 4 deletions

View File

@@ -212,7 +212,7 @@ Modules ModulesHandler::modules() const
void ModulesHandler::removeModule(const QString &modulePath)
{
if (ModuleItem *item = moduleFromPath(m_model->rootItem(), modulePath))
m_model->takeItem(item);
delete m_model->takeItem(item);
}
void ModulesHandler::updateModule(const Module &module)
@@ -254,7 +254,7 @@ void ModulesHandler::endUpdateAll()
for (int i = root->rowCount(); --i >= 0; ) {
auto item = static_cast<ModuleItem *>(root->child(i));
if (!item->updated)
m_model->takeItem(item);
delete m_model->takeItem(item);
}
}