[osg-users] ShaderComposer::releaseGLObjects warning

Robert Osfield robert.osfield at gmail.com
Wed Apr 27 02:54:54 PDT 2016


Hi Andy,

On 26 April 2016 at 20:31, Andy Skinner <Andy.Skinner at mathworks.com> wrote:

> Thanks for that fix.  There is a remaining issue, and I'm not sure if you
> would see it as a bug or a dodgy compiler warning.  :)
>
>
>
> We get a similar message about osgUtil::CullVisitor::clone().
>
>
>
> NodeVisitor uses META_Object, which brings in:
>
> virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new
> name (*this,copyop); }
>
>
>
> But CullVisitor defines clone as:
>
>         virtual CullVisitor* clone() const { return new
> CullVisitor(*this); }
>
>
>
> They differ in whether they take an argument.  I believe we've discussed
> this kind of thing before when considering using "using", and it was, if I
> remember correctly, a dodgy compiler warning then.
>
>
The osg::ShaderComposer warning did highlight a bug, but this warning isn't
highlighting an actual error.  If one calls clone(osg::CopyOp) then you'll
still git the correct clone() method.  It does highlight what is not ideal
coding style, and in this case it's a historical reason why there is this
clone() convenience method.  These days a osg::clone(object) would do just
as well without requiring the extra method, but this is a relatively modern
addition.

Could you try doing adding:

   using NodeVisitor::clone;

To the include/osgUtil/CullVisitor and see if that quietens the warning.

Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160427/8277e90e/attachment-0003.htm>


More information about the osg-users mailing list