--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/ConnectToDeviceDialog.java Wed Apr 07 14:48:51 2010 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/newwizard/ConnectToDeviceDialog.java Thu Apr 08 14:31:29 2010 -0500
@@ -41,6 +41,8 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.FontMetrics;
@@ -118,6 +120,15 @@
}
});
manager.addConnectionListener(this);
+
+ parent.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ manager.removeConnectionListener(ConnectToDeviceDialog.this);
+
+ if (currentServiceListener != null)
+ currentServiceListener.removeStatusChangedListener(ConnectToDeviceDialog.this);
+ }
+ });
final Composite buttonGroup = new Composite(viewerGroup, SWT.NONE);
int w = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.HORIZONTAL_MARGIN);
@@ -323,12 +334,5 @@
}
});
}
-
- @Override
- public boolean close() {
- manager.addConnectionListener(this);
- return super.close();
- }
-
}