Skip to content

Commit

Permalink
Correction to previous leak fix.
Browse files Browse the repository at this point in the history
- The actual reason the hidden node wasn't being released as expected
  was that ContainerListener::ModelNodeHidden() added a reference on
  behalf of its indirect target, while the latter never actually
  took ownership of said reference.
  • Loading branch information
anevilyak committed Dec 1, 2012
1 parent f4621a9 commit ea788ed
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -1036,7 +1036,7 @@ VariablesView::VariableTableModel::ValueNodeChildrenDeleted(ValueNode* node)
BReference<ModelNode> hiddenChild;
if (modelNode->CountChildren() == 1
&& modelNode->ChildAt(0)->IsHidden()) {
hiddenChild.SetTo(modelNode->ChildAt(0), true);
hiddenChild.SetTo(modelNode->ChildAt(0));
modelNode->RemoveChild(hiddenChild);
modelNode = hiddenChild;
fNodeTable.Remove(hiddenChild);
Expand Down Expand Up @@ -1788,8 +1788,10 @@ VariablesView::MessageReceived(BMessage* message)
case MSG_MODEL_NODE_HIDDEN:
{
ModelNode* node;
if (message->FindPointer("node", (void**)&node) == B_OK)
if (message->FindPointer("node", (void**)&node) == B_OK) {
BReference<ModelNode> modelNodeReference(node, true);
_RequestNodeValue(node);
}

break;
}
Expand Down

0 comments on commit ea788ed

Please sign in to comment.