forked from qt-creator/qt-creator
Debugger: Delete pointer if no more needed
Introduced with 2b19081cb0
Change-Id: I817ec48b9098f46ca703a6075d4657f0b7eb9948
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user