<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi Sebastien,<br>
    <br>
    I accept your point. But it works without <b>memory leak</b>. Thats
    why I choosed DeleteAll() method. Anyway here after I won't use
    that.<br>
    <br>
    As per your suggestion I tried the following code in Windows.<br>
    This too gives the same error window which is attached in the
    previous mail.<br>
    <br>
    private void formWindowClosed(java.awt.event.WindowEvent evt)
    {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Garbage Collection...<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanAxial.GetRenderer().RemoveAllViewProps();<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanAxial.GetRenderer().RemoveAllLights();<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    vpanAxial.GetRenderWindow().RemoveRenderer(vpanAxial.GetRenderer());<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanAxial = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanCoronal.GetRenderer().RemoveAllViewProps();<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanCoronal.GetRenderer().RemoveAllLights();<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    vpanCoronal.GetRenderWindow().RemoveRenderer(vpanCoronal.GetRenderer());<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanCoronal = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanSagittal.GetRenderer().RemoveAllViewProps();<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanSagittal.GetRenderer().RemoveAllLights();<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
vpanSagittal.GetRenderWindow().RemoveRenderer(vpanSagittal.GetRenderer());<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vpanSagittal = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resliceAxial = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resliceCoronal = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resliceSagittal = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; actorAxial = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; actorCoronal = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; actorSagittal = null;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader = null;<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.gc();<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vtkGlobalJavaHash.GC();<br>
    &nbsp;&nbsp;&nbsp; }<br>
    <br>
    Thanks,<br>
    Sathish<br>
    <br>
    <br>
    <br>
    On Saturday 21 May 2011 07:07 PM, Sebastien Jourdain wrote:
    <blockquote
      cite="mid:BANLkTikjFxSPQ-4aUvmC1QvzsowR9dbqSw@mail.gmail.com"
      type="cite">
      <pre wrap="">Hi Sathish,

You can give a try with that VTK. But for sure, you shouldn't call
DeleteAll() because your Frame/Panel is still alive in the Java world.

<a class="moz-txt-link-freetext" href="http://review.source.kitware.com/#q,status:open+project:VTK+branch:master+topic:vtk-java-improvement,n,z">http://review.source.kitware.com/#q,status:open+project:VTK+branch:master+topic:vtk-java-improvement,n,z</a>

Seb

PS: I didn't had the time yet to give a try of your code on my linux.
PS2: You have to use the VTK garbage collector. Look at the code
sample provided in the source...

On Sat, May 21, 2011 at 1:47 AM, Sathish Kumar <a class="moz-txt-link-rfc2396E" href="mailto:kingvsk@aol.com">&lt;kingvsk@aol.com&gt;</a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi All,

I am using VTK Java Wrapper. In Windows I get an error window while I close
my vtkRenderWindow.

My Code :

&nbsp; &nbsp;private void formWindowClosed(java.awt.event.WindowEvent evt) {
&nbsp; &nbsp; &nbsp; &nbsp;// Garbage Collection...
&nbsp; &nbsp; &nbsp; &nbsp;vtkGlobalJavaHash.DeleteAll();
&nbsp; &nbsp;}

If I delete the VTK objects Manually then it results in memory leak. But the
DeleteAll() method solves the memory leak but gives the following error
Message is a separate VTK Output Window. (Please find the attachment).

Error: In ..\..\VTKSources\Rendering\vtkWin32OpenGLRenderWindow.cxx
vtkWin32OpenGLRenderWindow (047E5DA0): wglMakeCurrent failed in clean

I can't scroll the error window to view further error message.

Thanks in Advance,

--
Sathish,

_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the VTK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>


</pre>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>