Reordered Reference::SetTo() operation so that it is safe to reinitialize to
the same referenceable. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33215 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e4823008da
commit
3bd94918ed
@ -83,10 +83,12 @@ public:
|
||||
|
||||
void SetTo(Type* object, bool alreadyHasReference = false)
|
||||
{
|
||||
if (object != NULL && !alreadyHasReference)
|
||||
object->AddReference();
|
||||
|
||||
Unset();
|
||||
|
||||
fObject = object;
|
||||
if (fObject && !alreadyHasReference)
|
||||
fObject->AddReference();
|
||||
}
|
||||
|
||||
void Unset()
|
||||
|
Loading…
Reference in New Issue
Block a user