[osg-users] image is not being freed
Sebastian Messerschmidt
sebastian.messerschmidt at gmx.de
Tue Apr 12 23:21:31 PDT 2016
Hi Bruno,
> Hello,
>
> I am creating an image from custom data pointer as follows, however,
> this does not result in freeing my memory after I delete the node and
> texture. How could this be?
>
> image->setImage(src->tileSize(), src->tileSize(),1,
> GL_RGBA8,
> GL_RGBA,
> GL_UNSIGNED_INT_8_8_8_8_REV,
> src->tileGridCoords(col, row).m_data.data(),
> osg::Image::NO_DELETE);
You are telling OSG that you handle the memory yourself by stating
NO_DELETE.
So basically you're responsible to delete it.
Cheers
Sebastian
>
> // Setup texture
> osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;
> texture->setImage(image.get());
>
> // Avoid background border between tiles
> //
> http://stackoverflow.com/questions/19611745/opengl-black-lines-in-between-tiles
> texture->setWrap(osg::Texture::WRAP_S,
> osg::Texture::CLAMP_TO_EDGE);
> texture->setWrap(osg::Texture::WRAP_T,
> osg::Texture::CLAMP_TO_EDGE);
>
> texture->setInternalFormatMode(osg::Texture2D::USE_S3TC_DXT1_COMPRESSION);
> texture->setUnRefImageDataAfterApply(
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160413/1fe17c9f/attachment-0003.htm>
More information about the osg-users
mailing list