summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorWojciech Sudol2013-11-05 09:12:55 (EST)
committer Gerrit Code Review @ Eclipse.org2013-11-05 10:35:04 (EST)
commit4785570b520291f4bf0597b3164c2813b3ca345d (patch)
tree2e3c10d8b647c6ea116f8cf8976694057206c8a0
parentb2eb153ae57dd6cb437dc03921ce0ee23affdf70 (diff)
downloadeclipse.platform.ui-4785570b520291f4bf0597b3164c2813b3ca345d.zip
eclipse.platform.ui-4785570b520291f4bf0597b3164c2813b3ca345d.tar.gz
eclipse.platform.ui-4785570b520291f4bf0597b3164c2813b3ca345d.tar.bz2
Bug 396296 - [JFace] jface ToolTip isn't disposed when underlyingrefs/changes/85/18085/3
control is disposed leading to errors. Change-Id: I978fc4d47e1256adeef3e5145495452ba6f6a823 Signed-off-by: Wojciech Sudol <wojciech.sudol@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.java
index 7310da7..e7932bf 100644
--- a/bundles/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.java
+++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/window/ToolTip.java
@@ -17,8 +17,6 @@ import java.util.HashMap;
import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
@@ -102,15 +100,6 @@ public abstract class ToolTip {
public ToolTip(Control control, int style, boolean manualActivation) {
this.control = control;
this.style = style;
- this.control.addDisposeListener(new DisposeListener() {
-
- public void widgetDisposed(DisposeEvent e) {
- data = null;
- deactivate();
- }
-
- });
-
this.listener = new ToolTipOwnerControlListener();
this.shellListener = new Listener() {
public void handleEvent(final Event event) {
@@ -453,6 +442,10 @@ public abstract class ToolTip {
CURRENT_TOOLTIP = null;
afterHideToolTip(event);
}
+ if (event != null && event.type == SWT.Dispose) {
+ deactivate();
+ data = null;
+ }
}
private void passOnEvent(Shell tip, Event event) {