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.
This commit is contained in:
Rene Gollent 2013-04-27 15:11:04 -04:00
parent fc23dd2ca2
commit 7198436cc2

View File

@ -1039,6 +1039,10 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
for (int32 i = modelNode->CountChildren() - 1; i >= 0 ; i--) {
BReference<ModelNode> 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();