public void close() { if (null == universe) return; universe.removeUniverseListener(this); // Must remove the listener so this instance can be garbage // collected and removed from the Canvas3D, overcomming the limit // of 32 total Canvas3D instances. try { final Method m = SimpleUniverse.class.getMethod("removeRenderingErrorListener", new Class[] { RenderingErrorListener.class }); if (null != m) m.invoke(universe, new Object[] { error_listener }); } catch (final Exception ex) { System.out.println("Could NOT remove the RenderingErrorListener!"); ex.printStackTrace(); } if (null != universe.getWindow()) universe.cleanup(); imp_updater.quit(); canvas3D.flush(); universe = null; dispose(); }