<!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)
{ <br>
// Garbage Collection...<br>
vpanAxial.GetRenderer().RemoveAllViewProps();<br>
vpanAxial.GetRenderer().RemoveAllLights();<br>
vpanAxial.GetRenderWindow().RemoveRenderer(vpanAxial.GetRenderer());<br>
vpanAxial = null;<br>
vpanCoronal.GetRenderer().RemoveAllViewProps();<br>
vpanCoronal.GetRenderer().RemoveAllLights();<br>
vpanCoronal.GetRenderWindow().RemoveRenderer(vpanCoronal.GetRenderer());<br>
vpanCoronal = null;<br>
vpanSagittal.GetRenderer().RemoveAllViewProps();<br>
vpanSagittal.GetRenderer().RemoveAllLights();<br>
vpanSagittal.GetRenderWindow().RemoveRenderer(vpanSagittal.GetRenderer());<br>
vpanSagittal = null;<br>
<br>
resliceAxial = null;<br>
resliceCoronal = null;<br>
resliceSagittal = null;<br>
actorAxial = null;<br>
actorCoronal = null;<br>
actorSagittal = null;<br>
reader = null;<br>
<br>
System.gc();<br>
vtkGlobalJavaHash.GC();<br>
}<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"><kingvsk@aol.com></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 :
private void formWindowClosed(java.awt.event.WindowEvent evt) {
// Garbage Collection...
vtkGlobalJavaHash.DeleteAll();
}
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>