<font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">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</font><div>
<font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)"><br></font></div><div><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">glTexImage2D(GL_TEXTURE_2D,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span>internalFormat,</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)"><span style="color:#c0c0c0"> </span>xsize,<span style="color:#c0c0c0"> </span>ysize,<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>,<span style="color:#c0c0c0"> </span>format,</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)"><span style="color:#c0c0c0"> </span>GL_UNSIGNED_BYTE,<span style="color:#c0c0c0"> </span><span style="color:#808000">static_cast</span><<span style="color:#808000">const</span><span style="color:#c0c0c0"> </span><span style="color:#800080">GLvoid</span><span style="color:#c0c0c0"> </span>*>(data));</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)">Which is in the following function</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="arial, helvetica, sans-serif" style="background-color:rgb(255,255,255)"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px">
<span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif"><span style="color:#808000">void</span><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkOpenGLImageSliceMapper</span>::RenderTexturedPolygon(</font></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif"><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkRenderer</span><span style="color:#c0c0c0"> </span>*ren,<span style="color:#c0c0c0"> </span><span style="color:#800080">vtkImageProperty</span><span style="color:#c0c0c0"> </span>*property,</font></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif"><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkImageData</span><span style="color:#c0c0c0"> </span>*input,<span style="color:#c0c0c0"> </span><span style="color:#808000">int</span><span style="color:#c0c0c0"> </span>extent[<span style="color:#000080">6</span>],<span style="color:#c0c0c0"> </span><span style="color:#808000">bool</span><span style="color:#c0c0c0"> </span>recursive)</font></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif"><br></font></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif">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.</font></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif"><br></font></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif">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.</font></span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif"><br></font></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="background-color:rgb(255,255,255)"><font face="arial, helvetica, sans-serif">Thanks</font></span></pre>
</pre></div>