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.
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:
However, if we execute the conversion logic but still end up returning nullptr, a memory leak occurs.