summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2008-11-19 17:29:47 +0000
committerSilenio Quarti <silenio>2008-11-19 17:29:47 +0000
commit282908e38c7906ceb71a643577f38a7ac43c52ef (patch)
tree9aad184e423139461e4c60cc7c8521f279154589 /bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java
parent34604d6edeef0973d083eca2ee115d0be6c8440f (diff)
downloadeclipse.platform.swt-282908e38c7906ceb71a643577f38a7ac43c52ef.tar.gz
eclipse.platform.swt-282908e38c7906ceb71a643577f38a7ac43c52ef.tar.xz
eclipse.platform.swt-282908e38c7906ceb71a643577f38a7ac43c52ef.zip
255637 - Missing removeComponentListener in SWT_AWT.new_Shell
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java b/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java
index 77421fc209..c42f8f3d88 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT AWT/motif/org/eclipse/swt/awt/SWT_AWT.java
@@ -35,6 +35,7 @@ import java.awt.Window;
import java.awt.event.AWTEventListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
import java.awt.event.WindowEvent;
@@ -301,7 +302,7 @@ public static Shell new_Shell (final Display display, final Canvas parent) {
if (handle == 0) SWT.error (SWT.ERROR_INVALID_ARGUMENT, null, " [peer not created]");
final Shell shell = Shell.motif_new (display, handle);
- parent.addComponentListener(new ComponentAdapter () {
+ final ComponentListener listener = new ComponentAdapter () {
public void componentResized (ComponentEvent e) {
display.syncExec (new Runnable () {
public void run () {
@@ -310,6 +311,12 @@ public static Shell new_Shell (final Display display, final Canvas parent) {
}
});
}
+ };
+ parent.addComponentListener(listener);
+ shell.addListener(SWT.Dispose, new Listener() {
+ public void handleEvent(Event event) {
+ parent.removeComponentListener(listener);
+ }
});
shell.setVisible (true);
return shell;