[osg-users] ShaderComposer::releaseGLObjects warning

Andy Skinner Andy.Skinner at mathworks.com
Wed Apr 27 11:09:03 PDT 2016


Yes, the "using" statement does quiet the warning.

Does that mean this is the solution, or that this just shows that there isn't a problem?  The reason I ask is that we've discussed the "using" statement for things like this before, and I don't believe you were in favor of it.  But using it would let us remove a bunch of warning handling in our use of OSG.

thanks
andy

From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Wednesday, April 27, 2016 5:55 AM
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Subject: Re: [osg-users] ShaderComposer::releaseGLObjects warning

Hi Andy,

On 26 April 2016 at 20:31, Andy Skinner <Andy.Skinner at mathworks.com<mailto: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/1402fae6/attachment-0002.htm>


More information about the osg-users mailing list