Well, the reason is simple:

I've a preview class which takes an OSG node, attaches it to a manager
and renders once. The node has then to be removed from the
previewGraph. To accomplish this the refcount of the node has to be
incremented before removing it.

The result is that the node has refcount zero when passing it to the
preview class and returns with refcount one. Side effect: if attached
to another root refount becomes 2 and is never deleted (when root is
deleted). I've to subref the previewed node once added again to the
root node. This is dirty and not code clear...

I'll find a solution... thanks anyway,

Josef

On Thu, Jun 26, 2008 at 4:00 PM, Carsten Neumann
<[EMAIL PROTECTED]> wrote:
>        Hello Josef,
>
> Josef Grunig wrote:
>> Hi,
>>
>> Is it possible to set the refcount of a Node to zero without letting
>> OpenSG to destroy it.
>
> there is only an interface to increment/decrement the ref count, not to
> set its value and subRef will always destroy the container if the ref
> count becomes <= 0.
> Since in 1.x ref counting is basically done manually, you can create a
> Node and keep it with a ref count of zero, but only if you don't make it
> another Node's child.
> However, all this is quite hacky and relies on knowledge of
> implementation details. What is it you want to achieve ? There might be
> a more reliable solution.
>
>        Regards,
>                Carsten
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>



-- 
Josef Grunig

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to