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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user