Don't leak the hidden child if present.
This commit is contained in:
@@ -1033,12 +1033,13 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
|
|||||||
// in the case of an address node with a hidden child,
|
// in the case of an address node with a hidden child,
|
||||||
// we want to send removal notifications for the children
|
// we want to send removal notifications for the children
|
||||||
// instead.
|
// instead.
|
||||||
|
BReference<ModelNode> hiddenChild;
|
||||||
if (modelNode->CountChildren() == 1
|
if (modelNode->CountChildren() == 1
|
||||||
&& modelNode->ChildAt(0)->IsHidden()) {
|
&& modelNode->ChildAt(0)->IsHidden()) {
|
||||||
ModelNode* tempNode = modelNode->ChildAt(0);
|
hiddenChild.SetTo(modelNode->ChildAt(0), true);
|
||||||
modelNode->RemoveChild(tempNode);
|
modelNode->RemoveChild(hiddenChild);
|
||||||
modelNode = tempNode;
|
modelNode = hiddenChild;
|
||||||
fNodeTable.Remove(tempNode);
|
fNodeTable.Remove(hiddenChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i = 0; i < modelNode->CountChildren(); i++) {
|
for (int32 i = 0; i < modelNode->CountChildren(); i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user