SGPropertyNode must increment / decrement the reference counter in an aliased

node.

From Csaba Halász.
This commit is contained in:
Tim Moore 2009-01-14 12:10:23 +01:00
parent 800ad40c4c
commit 2d11419cba

View File

@ -477,6 +477,7 @@ SGPropertyNode::clearValue ()
case NONE: case NONE:
break; break;
case ALIAS: case ALIAS:
put(_value.alias);
_value.alias = 0; _value.alias = 0;
break; break;
case BOOL: case BOOL:
@ -661,6 +662,7 @@ SGPropertyNode::SGPropertyNode (const SGPropertyNode &node)
break; break;
case ALIAS: case ALIAS:
_value.alias = node._value.alias; _value.alias = node._value.alias;
get(_value.alias);
_tied = false; _tied = false;
break; break;
case BOOL: case BOOL:
@ -776,6 +778,7 @@ SGPropertyNode::alias (SGPropertyNode * target)
if (target == 0 || _type == ALIAS || _tied) if (target == 0 || _type == ALIAS || _tied)
return false; return false;
clearValue(); clearValue();
get(target);
_value.alias = target; _value.alias = target;
_type = ALIAS; _type = ALIAS;
return true; return true;
@ -800,8 +803,7 @@ SGPropertyNode::unalias ()
{ {
if (_type != ALIAS) if (_type != ALIAS)
return false; return false;
_type = NONE; clearValue();
_value.alias = 0;
return true; return true;
} }