Skip to content

Commit

Permalink
Avoid memory leaks in MemWatchModel::clearRoot().
Browse files Browse the repository at this point in the history
The method would previously remove children, but without deleting them.
  • Loading branch information
cristian64 committed May 17, 2024
1 parent 226da82 commit 414da8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/GUI/MemWatcher/MemWatchModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ void MemWatchModel::editEntry(MemWatchEntry* entry, const QModelIndex& index)

void MemWatchModel::clearRoot()
{
m_rootNode->removeChildren();
emit layoutChanged();
beginResetModel();
m_rootNode->deleteChildren();
endResetModel();
}

void MemWatchModel::removeNode(const QModelIndex& index)
Expand Down

0 comments on commit 414da8d

Please sign in to comment.