Hi,
I have a function which I want to return a group, with two alternatives:
Code:
osg::ref_ptr osg::Group returnGroup()
{
osg::ref_ptr osg::Group group = new osg::Group;
...
return group;
}
Code:
osg::Group * returnGroup()
{
osg::Group * group = new osg::Group;
...
return group;
}
Hi Juan,
Returning a reference counted pointer is in general the safest thing to do
as it ensures that the object will get deleted when it goes out of scope.
A quick search of the osg-users will reveal a number of threads on the
subject alternatively try the link below:
Juan Herrera juan...@gmail.com writes:
Hi,
I have a function which I want to return a group, with two alternatives:
Code:
osg::ref_ptr osg::Group returnGroup()
{
osg::ref_ptr osg::Group group = new osg::Group;
...
return group;
}
Code:
osg::Group * returnGroup()
{
3 matches
Mail list logo