Hello, J-S.

I had forgotten about the release option.

Thanks!

D.J.

On Wed, Jan 26, 2011 at 1:39 PM, Jean-Sébastien Guay <
[email protected]> wrote:

> Hello Werner, D.J.,
>
>
> I would recommend that you either: 1)
>> use ref_ptr as your return type, or 2) wait to use ref_ptr outside of
>> "createObject".
>>
>
> Or return obj1.release() instead of obj1.get().
>
> This tells the ref_ptr to decrease its ref count, but not delete the object
> if it gets to 0 (contrary to get()). Which is what will happen in your case
> (check with a debugger).
>
> Incidentally, using a debugger would also have told you why it crashes...
> checking the pointer after the call to your function would have shown you
> that it had been deleted.
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay    [email protected]
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to