remove circular reference in Physical::_physical_node_path.

This commit is contained in:
rdb 2012-07-07 18:59:23 +00:00
parent 3ddad3e2d2
commit ece7ed20e1
3 changed files with 1 additions and 5 deletions

View File

@ -148,7 +148,7 @@ get_physical_node() const {
////////////////////////////////////////////////////////////////////
INLINE NodePath Physical::
get_physical_node_path() const {
return _physical_node_path;
return NodePath(_physical_node);
}
////////////////////////////////////////////////////////////////////

View File

@ -49,5 +49,4 @@ INLINE void PhysicalNode::
add_physical(Physical *physical) {
_physicals.push_back(physical);
physical->_physical_node = this;
physical->_physical_node_path = NodePath(this);
}

View File

@ -69,10 +69,8 @@ add_physicals_from(const PhysicalNode &other) {
_physicals.insert(_physicals.end(),
other._physicals.begin(), other._physicals.end());
NodePath node_path(this);
for (; last != _physicals.end(); last++) {
(*last)->_physical_node = this;
(*last)->_physical_node_path = node_path;
}
}
@ -103,7 +101,6 @@ remove_physical(int index) {
pvector< PT(Physical) >::iterator remove;
remove = _physicals.begin() + index;
(*remove)->_physical_node = (PhysicalNode *) NULL;
(*remove)->_physical_node_path = NodePath();
_physicals.erase(remove);
}