Skip to content

Commit

Permalink
Don't leak the hidden child if present.
Browse files Browse the repository at this point in the history
  • Loading branch information
anevilyak committed Dec 1, 2012
1 parent 6be1e37 commit f4621a9
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -1033,12 +1033,13 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
// in the case of an address node with a hidden child,
// we want to send removal notifications for the children
// instead.
BReference<ModelNode> hiddenChild;
if (modelNode->CountChildren() == 1
&& modelNode->ChildAt(0)->IsHidden()) {
ModelNode* tempNode = modelNode->ChildAt(0);
modelNode->RemoveChild(tempNode);
modelNode = tempNode;
fNodeTable.Remove(tempNode);
hiddenChild.SetTo(modelNode->ChildAt(0), true);
modelNode->RemoveChild(hiddenChild);
modelNode = hiddenChild;
fNodeTable.Remove(hiddenChild);
}

for (int32 i = 0; i < modelNode->CountChildren(); i++) {
Expand Down

0 comments on commit f4621a9

Please sign in to comment.