From 90753bf8054b6837d66348398b47d6ff24246dd1 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Tue, 5 Jul 2011 00:57:29 +0000 Subject: [PATCH] Fix leaking of type references. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42381 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/value/value_nodes/BMessageValueNode.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp b/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp index d9b0e43e09..c8053128a2 100644 --- a/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp +++ b/src/apps/debugger/value/value_nodes/BMessageValueNode.cpp @@ -319,11 +319,14 @@ BMessageValueNode::CreateChildren() type_code type; int32 count; Type* fieldType = NULL; + BReference typeRef; for (int32 i = 0; fMessage.GetInfo(B_ANY_TYPE, i, &name, &type, &count) == B_OK; i++) { fieldType = NULL; _GetTypeForTypeCode(type, fieldType); + if (fieldType != NULL) + typeRef.SetTo(fieldType, true); BMessageFieldNodeChild* node = new(std::nothrow) BMessageFieldNodeChild(this, @@ -603,6 +606,8 @@ BMessageValueNode::BMessageFieldNode::CreateChildren() status_t error = fParent->_GetTypeForTypeCode(fFieldType, type); if (error != B_OK) return error; + + BReference typeRef(type, true); for (int32 i = 0; i < fFieldCount; i++) { BMessageFieldNodeChild* child = new(std::nothrow) BMessageFieldNodeChild(fParent, type, fName, fFieldType, fFieldCount, i);