[osg-users] Deleting osg::Image that is shallow copied

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Tue Aug 16 03:17:40 PDT 2016


Hi Pierre
> Hi,
>
> In my application I have two osg::Images, the second one is a shallow copy of the first one thanks to the copy constructor.
> Is it safe to delete the first image and keep only the second one, or should I use deep copy instead?
> My tests showed me that the data is still reachable but when looking at the image destructor it clearly deallocates the data.
What do you mean by "reachable"? Deallocation doesn't mean the memory is 
cleaned or something. So having a raw pointer to the deallocated memory 
might give you the same data as long as no one is allocating memory there.

Cheers
Sebastian
>
> Thanks for enlightening me,
>
> Cheers,
> Pierre-Jean
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68380#68380
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





More information about the osg-users mailing list