summaryrefslogtreecommitdiffstats
path: root/src/gleem/ManipManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/gleem/ManipManager.java')
-rw-r--r--src/gleem/ManipManager.java13
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