osg2vsg
osg2vsg copied to clipboard
Memory Leak in vsg::ref_ptr<vsg::Data> when using convertToVsg with osg::Image
In the function vsg::ref_ptrvsg::Data convertToVsg(const osg::Image* image, bool mapRGBtoRGBAHint), if we simply return nullptr without performing any additional operations, no memory leak occurs:
vsg::ref_ptr<vsg::Data> convertToVsg(const osg::Image* image, bool mapRGBtoRGBAHint)
{
return nullptr;
}
However, if we execute the conversion logic but still end up returning nullptr, a memory leak occurs.