Hi Alvaro,

As pointed by Christian all your problems are pure C++ problems. I
recommend you to learn more C++ and how to code to avoid leaks and memory
corruption and for OSG I recommend you get a copy of the Quick Start Guide.

Doing a quick review I've discovered that your are returning a pointer from
a local variable created inside "crearMultipleVenata" so after the function
returns that viewer is destroyed!. Use a raw pointer or even better a
osg::ref_ptr<>, but really you need to read about smart pointers in C++ and
also how the smart pointers are used in OSG :)

Also I recommend as a general rule use always English in the code (even for
the comments), using Spanish will be easy for you but others might don't
understand the meaning of the methods.

Regards,
Rafa.


El jue., 30 jul. 2015 a las 12:31, alvaro ginestar rodriguez (<
[email protected]>) escribió:

> hi everyone !!. i have a problem with return viewer in a fuction, and to
> add the viewer of the fuction in de main.
> _______________________________________________
> 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