[vtkusers] QVTKWidget2 memory leak?

Jonathan Morra jonmorra at gmail.com
Fri Feb 24 16:19:59 EST 2012


I have recently converted my app from using QVTKWidget to QVTKWidget2 so
that I could paint on the QVTKWidget2 (which I was able to successfully
do).  After this conversion my app started to leak memory terribly.  I
followed the memory leak around, and found the culprit is the following line

glTexImage2D(GL_TEXTURE_2D, 0, internalFormat,

                   xsize, ysize, 0, format,

                   GL_UNSIGNED_BYTE, static_cast<const GLvoid *>(data));


Which is in the following function


void vtkOpenGLImageSliceMapper::RenderTexturedPolygon(

  vtkRenderer *ren, vtkImageProperty *property,

  vtkImageData *input, int extent[6], bool recursive)


I am using a build that I got from git on January 10th.  I have a 64
bit Windows 7 machine, but have built VTK with Microsoft Visual
Studios 2008 32 bit.


This bug is manifested everytime I call render on a QVTKWidget2 that I
have placed a vtkImageViewer2 in.  This is a very critical bug for us
as now our program runs out of memory very quickly because there are
situations where render is called on every mouse move which means the
program will die extremely fast.  Any help would be appreciated.


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120224/a53ade7f/attachment.htm>


More information about the vtkusers mailing list