Hi Linix, The use of virtual inheritance should not cause deletion problems, I would suspect a problem elsewhere in your application - could it be that the object is being accessed after or during it's deletion?
Robert. On 29 November 2011 13:03, Lilinx <[email protected]> wrote: > Robert Osfield,您好! > > HI Robert, > If the "virtual" is existed, I cannot delete a AnimationPath Object in my > program. > > I use the animationpath like this: > void Fun1() > { > osg::AnimationPath* path = new osg::AnimationPath; > path->insert(...) > osg::AnimationPathCallback* cb = new osg::AnimationPathCallback(path, > 0.0,1.0); > osg::MatrixTransform* node; > node->... > node->setUpdateCallback(cb); > } > > void Fun2() > { > ... > node->setUpdateCallback(NULL); > // there ,the callback is set to NULL; so , the animationpath in > AnimationPathCallback > //will delete automatically. > // I Got a Crash there. > } > > Fun1() Fun2() is called in osg update stage. > > maybe we change : > AnimationPath():_loopMode(LOOP) {} > to > AnimationPath():_loopMode(LOOP),Object() {} > > > ======= 2011-11-29 20:41:12 您在来信中写道:======= > >>Hi Lilinx, >> >>The world "virtual" is very much intended, it's called virtual >>inheritance and allows you do multiple inheritance from >>osg::AnimationPath and another parent class like a callback taht also >>inherits from osg::Object. >> >>Robert. >> >>On 29 November 2011 12:31, Lilinx <[email protected]> wrote: >>> Hi, All >>> I change >>> class OSG_EXPORT AnimationPath : public virtual osg::Object >>> to >>> class OSG_EXPORT AnimationPath : public osg::Object >>> >>> remove the word "virtual" . >>> >>> >>> >>> >>> Lilinx >>> [email protected] >>> 2011-11-29 >>> _______________________________________________ >>> osg-submissions mailing list >>> [email protected] >>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >>> >>_______________________________________________ >>osg-submissions mailing list >>[email protected] >>http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> > > = = = = = = = = = = = = = = = = = = = = > > > 致 > 礼! > > > Lilinx > [email protected] > 2011-11-29 > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
