Tomás Aguado Gómez <tomas.aguado@xxxxxxxxxxxxxx> wrote:
: Hi Morten:
: Yesterday I changed my code, and now the count reference (I see it with
: the get Count reference Method) goes to zero when I "unref()" the node,
: but the element (for example an sphere) stills remains there, as I read
: in the inventor Mentor, if you unref() and the count reference goes to
: zero the node is deleted from the scene.
Are you just calling unref() on a node that is the child of a group,
or do you also use SoGroup::removeChild()? You shouldn't just unref()
a node you haven't decided to manage yourself by ref()ing it earlier.
The refs for child nodes of groups are handled by their parent group
node, so only if you have called an additional ref() on it should
you ever unref() it. You should just use removeChild() to remove a node
from a group.
Lars J
|