Skip to content

Commit

Permalink
Fix delete vs release issues in BMessageValueNode.
Browse files Browse the repository at this point in the history
  • Loading branch information
anevilyak committed Dec 7, 2012
1 parent dda60bf commit f2ebf00
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/apps/debugger/value/value_nodes/BMessageValueNode.cpp
Expand Up @@ -183,66 +183,62 @@ BMessageValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
if (strcmp(member->Name(), "fHeader") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) {
TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n",
strerror(error));
delete memberLocation;
return error;
}

error = valueLoader->LoadValue(memberLocation, valueType,
false, headerAddress);
delete memberLocation;
if (error != B_OK)
return error;
} else if (strcmp(member->Name(), "what") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) {
TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n",
strerror(error));
delete memberLocation;
return error;
}
error = valueLoader->LoadValue(memberLocation, valueType,
false, what);
delete memberLocation;
if (error != B_OK)
return error;
} else if (strcmp(member->Name(), "fFields") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) {
TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of field member: %s\n",
strerror(error));
delete memberLocation;
return error;
}
error = valueLoader->LoadValue(memberLocation, valueType,
false, fieldAddress);
delete memberLocation;
if (error != B_OK)
return error;
} else if (strcmp(member->Name(), "fData") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) {
TRACE_LOCALS(
"BMessageValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of data member: %s\n",
strerror(error));
delete memberLocation;
return error;
}
error = valueLoader->LoadValue(memberLocation, valueType,
false, fDataLocation);
delete memberLocation;
if (error != B_OK)
return error;
}
Expand Down

0 comments on commit f2ebf00

Please sign in to comment.