diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index 0e62454b78f..5c37a8b1d14 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -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(root->child(i)); if (!item->updated) - m_model->takeItem(item); + delete m_model->takeItem(item); } } diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 97c90afa163..1bef8ea50a0 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1164,7 +1164,7 @@ void WatchModel::insertItem(WatchItem *item) if (WatchItem *existing = parent->findItem(item->iname)) { int row = parent->children().indexOf(existing); - takeItem(existing); + delete takeItem(existing); parent->insertChild(row, item); } else { parent->appendChild(item); @@ -1233,7 +1233,7 @@ void WatchHandler::purgeOutdatedItems(const QSet &inames) { foreach (const QByteArray &iname, inames) { WatchItem *item = findItem(iname); - m_model->takeItem(item); + delete m_model->takeItem(item); } m_model->layoutChanged();