From 7198436cc28efa74e16de67ec8cc1068a9856068 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 27 Apr 2013 15:11:04 -0400 Subject: [PATCH] Fix several crash problems in Debugger. - When removing a value node in response to ValueNodeChildrenDeleted, we need to recurse down and ensure that each node's children are likewise notified/removed. Otherwise we end up with deleted child nodes in the node table, which in turn led to potential crashes when either adjusting a node's type and/or its visible array range. --- .../debugger/user_interface/gui/team_window/VariablesView.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp index 0a1c9a1953..df5ec67ad1 100644 --- a/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/VariablesView.cpp @@ -1039,6 +1039,10 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node) for (int32 i = modelNode->CountChildren() - 1; i >= 0 ; i--) { BReference childNode = modelNode->ChildAt(i); + // recursively remove the current node's child hierarchy. + if (childNode->CountChildren() != 0) + ValueNodeChildrenDeleted(childNode->NodeChild()->Node()); + TreeTablePath treePath; if (GetTreePath(childNode, treePath)) { int32 index = treePath.RemoveLastComponent();