info-inventor-dev
[Top] [All Lists]

Re: QT+COIN

To: Tomás Aguado Gómez <tomas.aguado@xxxxxxxxxxxxxx>
Subject: Re: QT+COIN
From: "Lars J. Aas" <larsa@xxxxxx>
Date: Mon, 1 Nov 2004 14:22:17 +0100
Cc: Morten Eriksen <mortene@xxxxxx>, info-inventor-dev@xxxxxxxxxxx
In-reply-to: <41864223.1020804@xxxxxxxxxxxxxx>
References: <4180B321.7080803@xxxxxxxxxxxxxx> <20041028110113.GF20769@xxxxxx> <41836F5C.1050607@xxxxxxxxxxxxxx> <Pine.LNX.4.58.0411011204220.21479@xxxxxxxxxxxxxxxxxxx> <41864223.1020804@xxxxxxxxxxxxxx>
Sender: info-inventor-dev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6i
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

<Prev in Thread] Current Thread [Next in Thread>