From e534e4d1ed5299408deaad6ac201c3589bc78c28 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 30 Jul 2005 18:44:18 +0000 Subject: [PATCH] Added setStateSet(0) to destructors to force the problem clean up of attached StateSets. --- src/osg/Drawable.cpp | 3 +++ src/osg/Node.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index d2ea9a2cf..61fdf1795 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -299,6 +299,9 @@ Drawable::Drawable(const Drawable& drawable,const CopyOp& copyop): Drawable::~Drawable() { + // cleanly detatch any associated stateset (include remove parent links) + setStateSet(0); + dirtyDisplayList(); } diff --git a/src/osg/Node.cpp b/src/osg/Node.cpp index 7043eef6a..6cddd0318 100644 --- a/src/osg/Node.cpp +++ b/src/osg/Node.cpp @@ -57,6 +57,8 @@ Node::Node(const Node& node,const CopyOp& copyop): Node::~Node() { + // cleanly detatch any associated stateset (include remove parent links) + setStateSet(0); } void Node::addParent(osg::Group* node)