| 76 | } |
| 77 | |
| 78 | public void Delete() { |
| 79 | this.lock.lock(); |
| 80 | |
| 81 | // We prevent any further rendering |
| 82 | inRenderCall = true; |
| 83 | |
| 84 | if (this.uiComponent.getParent() != null) { |
| 85 | this.uiComponent.getParent().remove(this.uiComponent); |
| 86 | } |
| 87 | super.Delete(); |
| 88 | |
| 89 | // On linux we prefer to have a memory leak instead of a crash |
| 90 | if (!this.renderWindow.GetClassName().equals("vtkXOpenGLRenderWindow")) { |
| 91 | this.renderWindow = null; |
| 92 | } else { |
| 93 | System.out.println("The renderwindow has been kept around to prevent a crash"); |
| 94 | } |
| 95 | this.lock.unlock(); |
| 96 | vtkObject.JAVA_OBJECT_MANAGER.gc(false); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * @return true if the graphical component has been properly set and |