diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index 94d558851af..e37c44ccbba 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -327,7 +327,8 @@ void ModulesHandler::endUpdateAll() if (!item->updated) toDestroy.append(item); }); - qDeleteAll(toDestroy); + for (TreeItem *item : toDestroy) + m_model->destroyItem(item); } } // namespace Internal