Hello Josef,
Josef Grunig wrote:
> 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.
hm, one could argue that the problem is actually the initial ref count
zero; objects should not have a ref count of zero for any length of
time. Unfortunately this is quite common though (we believe to have a
better solution in 2 ;) ).
> 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,
how about using NodeRefPtr for passing around the node ?
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