41eb850578
CID 11447: Unchecked dynamic_cast (FORWARD_NULL) Dynamic cast to pointer "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))" can return null. Assigning null: "first" = "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))". The clone() implementation is written using macro's so that it always returns the type of Object being cloned so it's normally safe to assume that a dynamic_cast<> will always return a valid pointer as long as the new T that involves creates a valid object. However, if the class being cloned doesn't correctly implement the clone() method then their potential for the dynamic_cast to fail and will return a NULL and will result in a memory leak of the object of paraent class that the clone would have defaulted to. I've tightened up the CopyOp.cpp code to check the return type and added better handling of the clone in the osg::clone() methods so thay don't have any potential mememory leaks and report warnings to OSG_WARN when problems are encountered. It may be more apporpriate to throw an exception so will need to ponder this issue further. |
||
---|---|---|
.. | ||
OpenThreads | ||
osg | ||
osgAnimation | ||
osgDB | ||
osgFX | ||
osgGA | ||
osgManipulator | ||
osgParticle | ||
osgPresentation | ||
osgQt | ||
osgShadow | ||
osgSim | ||
osgTerrain | ||
osgText | ||
osgUtil | ||
osgViewer | ||
osgVolume | ||
osgWidget |