diff --git a/debugger/util/treeitem.cpp b/debugger/util/treeitem.cpp --- a/debugger/util/treeitem.cpp +++ b/debugger/util/treeitem.cpp @@ -121,10 +121,7 @@ // Only delete the children after removing them // from model. Otherwise, the model will touch // deleted things, with undefined results. - for (int i = 0; i < childItems.size(); ++i) { - TreeItem* v = child(i); - delete v; - } + qDeleteAll(copy); } void TreeItem::clear()