From 0c7e048d2881c24e2acd341849b82d27cea8a716 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 3 Jul 2003 00:32:32 +0000 Subject: [PATCH] save self pointer during stash --- panda/src/pgraph/pandaNode.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/panda/src/pgraph/pandaNode.cxx b/panda/src/pgraph/pandaNode.cxx index 64288f918d..ece30980a4 100644 --- a/panda/src/pgraph/pandaNode.cxx +++ b/panda/src/pgraph/pandaNode.cxx @@ -1024,6 +1024,13 @@ replace_child(PandaNode *orig_child, PandaNode *new_child) { void PandaNode:: stash_child(int child_index) { nassertv(child_index >= 0 && child_index < get_num_children()); + + // Save a reference count for ourselves. I don't think this should + // be necessary, but there are occasional crashes in stash() during + // furniture moving mode. Perhaps this will eliminate those + // crashes. + PT(PandaNode) self = this; + PT(PandaNode) child_node = get_child(child_index); int sort = get_child_sort(child_index);