Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348877

Summary: [JFace] org.eclipse.jface.window.ToolTip disposing bug
Product: [Eclipse Project] Platform Reporter: Yelyena <elenstr>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: elenstr, jamie.wickens, Lars.Vogel, pwebster, robert.roth.off
Version: 3.6Keywords: ui
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Yelyena CLA 2011-06-09 08:00:12 EDT
Build Identifier: 3.6.0

This bug appears when toolTip is shown in a just opened shell for some focused control(text, combo).


This bug could be fixed this way(when you create handler for shell listener) you have to check whether tooltip was disposed and only after that check if it is CURRENT_TOOLTIP:

control.getDisplay().asyncExec(new Runnable() {
  public void run() {
    if (!control.isDisposed() && control.getDisplay().getActiveShell() != CURRENT_TOOLTIP) {
 toolTipHide(CURRENT_TOOLTIP, event);
}
}
});

Reproducible: Always

Steps to Reproduce:
1.Create simple shell with text control(for example) and button "Apply" 
2.Create DefaultToolTip for text control
4.Open this shell and press Apply button(some times this bug happens when user presses window close button(x)).
Comment 1 Yelyena CLA 2011-06-09 08:04:53 EDT
Uncaught exception
  org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
    at org.eclipse.swt.SWT.error(SWT.java:4083)
    at org.eclipse.swt.SWT.error(SWT.java:3998)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at com.uwiss.jenive.swtjface.AbstractApp$1.run(AbstractApp.java:99)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at com.uwiss.jenive.swtjface.AbstractApp.run(AbstractApp.java:80)
    at com.uwiss.nederinum.client.App.main(App.java:51)
  Caused by: org.eclipse.swt.SWTException: Widget is disposed
    at org.eclipse.swt.SWT.error(SWT.java:4083)
    at org.eclipse.swt.SWT.error(SWT.java:3998)
    at org.eclipse.swt.SWT.error(SWT.java:3969)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
    at org.eclipse.swt.widgets.Widget.getDisplay(Widget.java:582)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    ... 6 more
Comment 2 Yelyena CLA 2011-06-09 08:09:30 EDT
Uncaught exception
  org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
    at org.eclipse.swt.SWT.error(SWT.java:4083)
    at org.eclipse.swt.SWT.error(SWT.java:3998)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at com.uwiss.jenive.swtjface.AbstractApp$1.run(AbstractApp.java:99)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at com.uwiss.jenive.swtjface.AbstractApp.run(AbstractApp.java:80)
    at com.uwiss.nederinum.client.App.main(App.java:51)
  Caused by: org.eclipse.swt.SWTException: Widget is disposed
    at org.eclipse.swt.SWT.error(SWT.java:4083)
    at org.eclipse.swt.SWT.error(SWT.java:3998)
    at org.eclipse.swt.SWT.error(SWT.java:3969)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
    at org.eclipse.swt.widgets.Widget.getDisplay(Widget.java:582)
    at org.eclipse.jface.window.ToolTip$3.run(ToolTip.java:124)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    ... 6 more
Comment 3 Yelyena CLA 2011-06-09 08:12:18 EDT
This error report is not quite right
Comment 4 Yelyena CLA 2011-06-09 08:14:24 EDT
(In reply to comment #3)
> This error report is not quite right

First of two error reports is not quite right, use second
Comment 5 Jamie Wickens CLA 2011-08-09 10:47:11 EDT
Another vote for this...
The ToolTip shell listener should not be checking for whether the control is disposed and then scheduling a Runnable on the display thread as the control may have been disposed by the time it gets scheduled.

This check should be performed within the Runnable as Yelyena points out.
Comment 6 Christoph Keimel CLA 2012-05-18 03:17:43 EDT
Another Vote for this
Comment 8 Lars Vogel CLA 2016-01-05 04:33:42 EST

*** This bug has been marked as a duplicate of bug 462065 ***