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:
@@ -1039,6 +1039,10 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
|
|||||||
|
|
||||||
for (int32 i = modelNode->CountChildren() - 1; i >= 0 ; i--) {
|
for (int32 i = modelNode->CountChildren() - 1; i >= 0 ; i--) {
|
||||||
BReference<ModelNode> childNode = modelNode->ChildAt(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;
|
TreeTablePath treePath;
|
||||||
if (GetTreePath(childNode, treePath)) {
|
if (GetTreePath(childNode, treePath)) {
|
||||||
int32 index = treePath.RemoveLastComponent();
|
int32 index = treePath.RemoveLastComponent();
|
||||||
|
|||||||
Reference in New Issue
Block a user