<div dir="ltr"><div>OK, I understand that. I do that because I own the data pointer I'm sending, and I am totally sure I am freeing it. However, some other copy remains anywhere, and I don't have access to it.<br><br></div>If I delete the osg::Group where I am attaching images and re-add the same imgaes, no more memory is allocated, so it is using the same buffers somehow, but I can't force it to free the memory when I want to<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-13 7:21 GMT+01:00 Sebastian Messerschmidt <span dir="ltr"><<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hi Bruno,<br>
    </div><span class="">
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>Hello, <br>
            <br>
          </div>
          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?<br>
          <br>
          image->setImage(src->tileSize(), src->tileSize(),1,<br>
                                      GL_RGBA8,<br>
                                      GL_RGBA,<br>
                                      GL_UNSIGNED_INT_8_8_8_8_REV,<br>
                                      src->tileGridCoords(col,
          row).m_data.data(),<br>
                                      osg::Image::NO_DELETE);<br>
        </div>
      </div>
    </blockquote></span>
    You are telling OSG that you handle the memory yourself by stating
    NO_DELETE.<br>
    So basically you're responsible to delete it. <br>
    <br>
    Cheers<br>
    Sebastian <br>
    <blockquote type="cite"><span class="">
      <div dir="ltr">
        <div><br>
                      // Setup texture<br>
                      osg::ref_ptr<osg::Texture2D> texture = new
          osg::Texture2D;<br>
                      texture->setImage(image.get());<br>
          <br>
                      // Avoid background border between tiles<br>
                      // <a href="http://stackoverflow.com/questions/19611745/opengl-black-lines-in-between-tiles" target="_blank">http://stackoverflow.com/questions/19611745/opengl-black-lines-in-between-tiles</a><br>
                      texture->setWrap(osg::Texture::WRAP_S,
          osg::Texture::CLAMP_TO_EDGE);<br>
                      texture->setWrap(osg::Texture::WRAP_T,
          osg::Texture::CLAMP_TO_EDGE);<br>
          <br>
                     
texture->setInternalFormatMode(osg::Texture2D::USE_S3TC_DXT1_COMPRESSION);<br>
                      texture->setUnRefImageDataAfterApply( </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </span><pre>_______________________________________________
osg-users mailing list
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
<br></blockquote></div><br></div>