mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
keep reference count during statsh
This commit is contained in:
parent
a42f2c6a94
commit
f6fe58c262
@ -1654,6 +1654,10 @@ reparent(NodePathComponent *new_parent, NodePathComponent *child, int sort,
|
|||||||
bool as_stashed) {
|
bool as_stashed) {
|
||||||
nassertr(child != (NodePathComponent *)NULL, false);
|
nassertr(child != (NodePathComponent *)NULL, false);
|
||||||
|
|
||||||
|
// Keep a reference count to the new parent, since detaching the
|
||||||
|
// child might lose the count.
|
||||||
|
PT(NodePathComponent) keep_parent = new_parent;
|
||||||
|
|
||||||
if (!child->is_top_node()) {
|
if (!child->is_top_node()) {
|
||||||
detach(child);
|
detach(child);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user