diff options
author | Kenneth Russel <[email protected]> | 2005-09-09 07:08:45 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-09-09 07:08:45 +0000 |
commit | ffb098e3eed864346f1bd9f53021b17f9148da49 (patch) | |
tree | c95f36b4e25fb8facace3e8ead0827e61a80093e /src/gleem | |
parent | 6988570ed0a3ffa8f6d544cdb245cb7f0e77885c (diff) |
Refactored demos to mostly subclass common Demo superclass providing
shutdown capabilities. Moved DemoListener to demos.common package.
Added ManipManager removal code to demos using manipulators or
ExaminerViewer to fix memory leak when run in JRefract harness. Added
workaround for another seeming memory leak when run under current JDK
1.6 due to java.awt.Component now being finalizable and keeping data
alive longer than previously. Made ManipManager.unregisterWindow more
lenient with respect to null or invalid arguments.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@122 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/gleem')
-rw-r--r-- | src/gleem/ManipManager.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gleem/ManipManager.java b/src/gleem/ManipManager.java index 767c8cd..85a3d80 100644 --- a/src/gleem/ManipManager.java +++ b/src/gleem/ManipManager.java @@ -117,12 +117,17 @@ public class ManipManager { /** Remove all references to a given window, including removing all manipulators from it. */ public synchronized void unregisterWindow(GLAutoDrawable window) { + if (window == null) { + return; + } WindowInfo info = (WindowInfo) windowToInfoMap.get(window); - for (Iterator iter = info.manips.iterator(); iter.hasNext(); ) { - removeManipFromWindow((Manip) iter.next(), window); + if (info != null) { + for (Iterator iter = info.manips.iterator(); iter.hasNext(); ) { + removeManipFromWindow((Manip) iter.next(), window); + } + windowToInfoMap.remove(window); + removeMouseListeners(window); } - windowToInfoMap.remove(window); - removeMouseListeners(window); } /** Make a given manipulator visible and active in a given |