* Added missing ToReferenceable().

* _SetTo(const BVariant&): Acquire a reference for the wrong object.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31959 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-30 02:34:41 +00:00
parent 69f9a367bc
commit cdcacd7f9f
2 changed files with 10 additions and 1 deletions
+1
View File
@@ -86,6 +86,7 @@ public:
double ToDouble() const;
void* ToPointer() const;
const char* ToString() const;
BReferenceable* ToReferenceable() const;
void SwapEndianess();
// has effect only on scalar types (pointer
+9 -1
View File
@@ -336,13 +336,21 @@ BVariant::_SetTo(const BVariant& other)
}
} else if ((other.fFlags & B_VARIANT_REFERENCEABLE_DATA) != 0) {
if (other.fReferenceable != NULL)
fReferenceable->AcquireReference();
other.fReferenceable->AcquireReference();
}
memcpy(this, &other, sizeof(BVariant));
}
BReferenceable*
BVariant::ToReferenceable() const
{
return (fFlags & B_VARIANT_REFERENCEABLE_DATA) != 0
? fReferenceable : NULL;
}
void
BVariant::SwapEndianess()
{