Commit 90656ea4 authored by Christian Stenger's avatar Christian Stenger Committed by hjk

Debugger: Delete pointer if no more needed

Introduced with 2b19081c

Change-Id: I817ec48b9098f46ca703a6075d4657f0b7eb9948
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent d92055dd
......@@ -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);
}
}
......
......@@ -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<QByteArray> &inames)
{
foreach (const QByteArray &iname, inames) {
WatchItem *item = findItem(iname);
m_model->takeItem(item);
delete m_model->takeItem(item);
}
m_model->layoutChanged();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment