I will spend some time and try and put together a small self contained test.<br><br><div class="gmail_quote">On Fri, Feb 24, 2012 at 1:29 PM, Clinton Stimpson <span dir="ltr">&lt;<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Friday, February 24, 2012 02:19:59 pm Jonathan Morra wrote:<br>
&gt; I have recently converted my app from using QVTKWidget to QVTKWidget2 so<br>
&gt; that I could paint on the QVTKWidget2 (which I was able to successfully<br>
&gt; do).  After this conversion my app started to leak memory terribly.  I<br>
&gt; followed the memory leak around, and found the culprit is the following<br>
&gt; line<br>
&gt;<br>
&gt; glTexImage2D(GL_TEXTURE_2D, 0, internalFormat,<br>
&gt;<br>
&gt;                    xsize, ysize, 0, format,<br>
&gt;<br>
&gt;                    GL_UNSIGNED_BYTE, static_cast&lt;const GLvoid *&gt;(data));<br>
&gt;<br>
&gt;<br>
&gt; Which is in the following function<br>
&gt;<br>
&gt;<br>
&gt; void vtkOpenGLImageSliceMapper::RenderTexturedPolygon(<br>
&gt;<br>
&gt;   vtkRenderer *ren, vtkImageProperty *property,<br>
&gt;<br>
&gt;   vtkImageData *input, int extent[6], bool recursive)<br>
&gt;<br>
&gt;<br>
&gt; I am using a build that I got from git on January 10th.  I have a 64<br>
&gt; bit Windows 7 machine, but have built VTK with Microsoft Visual<br>
&gt; Studios 2008 32 bit.<br>
&gt;<br>
&gt;<br>
&gt; This bug is manifested everytime I call render on a QVTKWidget2 that I<br>
&gt; have placed a vtkImageViewer2 in.  This is a very critical bug for us<br>
&gt; as now our program runs out of memory very quickly because there are<br>
&gt; situations where render is called on every mouse move which means the<br>
&gt; program will die extremely fast.  Any help would be appreciated.<br>
&gt;<br>
<br>
</div></div>Ok, I see the cause of the problem.<br>
<br>
QVTKWidget2::Start() calls OpenGLInit(), which resets the context creation<br>
time and the vtkOpenGLImageSliceMapper reloads them thinking its a new<br>
context.<br>
<br>
It would helpful if you can provide a minimal test case to demonstrate this.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Clinton Stimpson<br>
Elemental Technologies, Inc<br>
Computational Simulation Software, LLC<br>
<a href="http://www.csimsoft.com" target="_blank">www.csimsoft.com</a><br>
</font></span></blockquote></div><br>