Fix issues with child creation in BMessage nodes.
BMessageValueNode and BMessageFieldNode weren't correctly setting the children created flag. This would result in duplicates of some of the nodes showing up, especially in the case of nested messages.
This commit is contained in:
@@ -330,9 +330,6 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
|
||||
status_t
|
||||
BMessageValueNode::CreateChildren()
|
||||
{
|
||||
if (!fChildren.IsEmpty())
|
||||
return B_OK;
|
||||
|
||||
DataMember* member = NULL;
|
||||
CompoundType* messageType = dynamic_cast<CompoundType*>(fType);
|
||||
for (int32 i = 0; i < messageType->CountDataMembers(); i++) {
|
||||
@@ -374,6 +371,8 @@ BMessageValueNode::CreateChildren()
|
||||
fChildren.AddItem(node);
|
||||
}
|
||||
|
||||
fChildrenCreated = true;
|
||||
|
||||
if (fContainer != NULL)
|
||||
fContainer->NotifyValueNodeChildrenCreated(this);
|
||||
|
||||
@@ -656,6 +655,8 @@ BMessageValueNode::BMessageFieldNode::CreateChildren()
|
||||
fChildren.AddItem(child);
|
||||
}
|
||||
|
||||
fChildrenCreated = true;
|
||||
|
||||
if (fContainer != NULL)
|
||||
fContainer->NotifyValueNodeChildrenCreated(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user