Hello Georg,
Georg Wünsch wrote:
> Hi Marcus,
>
> thank You for your very complete answer! As I had to go on with some work
> this weekend, I switched back to vs2005. Thank You for your hints, I will
> try the vc90 switch later again.
>
> The XXXRefPtr seems to help very much, I will try this immediately,
>
> just one question, if I do not delete the XXXRefPtr explicitly by setting it
> to NullFC, but by leaving the context where it is defined, will the
> refcounter also be decreased?
>
> In other words must I put it like:
>
> void doSomething(NodePtr& tNode)
> {
> NodeRefPtr aNode = tNode; // refCP to tNode will be increased
>
> ... do something with it...
>
> } // refCP to tNode will be decreased
> when aNode is deleted?
>
> Or must it be:
>
> void doSomething(NodePtr& tNode)
> {
> NodeRefPtr aNode = tNode; // refCP to tNode will be increased
>
> ... do something with it...
>
> aNode = NullFC; // refCP to tNode will be decreased ?
> }
both are fine, the XXXRefPtr d'tor does decrement the ref count of the
pointed to object. Explicitly assigning NullFC should only be necessary,
when you need to get rid of global objects or members without destroying
the enclosing object and similar situations.
Hope it helps,
Carsten
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users