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

Bug 263661

Summary: Widget disposed too early error when shutting down workbench.
Product: [Eclipse Project] Platform Reporter: Yuan Gan <ygan>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 3.4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Yuan Gan CLA 2009-02-04 11:43:12 EST
I work on websphere debug tool which is a produce based on eclipse.

We find that after our debugger has been launched (no matter if it has been disconnected or not before shutting down the workspace), if now we shut down the workspace, an error dialog will pop up and the following error will be logged in the .log file:


!ENTRY org.eclipse.ui.workbench 4 0 2009-02-04 09:49:30.953
!MESSAGE Widget disposed too early!
!STACK 0
java.lang.RuntimeException: Widget disposed too early!
	at org.eclipse.ui.internal.WorkbenchPartReference$1.widgetDisposed(WorkbenchPartReference.java:153)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:101)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:933)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:743)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:636)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:746)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:636)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:746)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:636)
	at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:117)
	at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:722)
	at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1062)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:746)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:415)
	at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:397)
	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:627)
	at org.eclipse.jface.window.Window.close(Window.java:330)
	at org.eclipse.jface.window.ApplicationWindow.close(ApplicationWindow.java:299)
	at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1510)
	at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:622)
	at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:598)
	at org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindow.java:713)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:711)
	at org.eclipse.jface.window.WindowManager.close(WindowManager.java:109)
	at org.eclipse.ui.internal.Workbench$12.run(Workbench.java:715)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:712)
	at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:642)
	at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:855)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:853)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:828)
	at org.eclipse.ui.internal.QuitAction.run(QuitAction.java:57)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)

!ENTRY org.eclipse.ui.workbench 4 0 2009-02-04 09:49:30.953
!MESSAGE Widget disposed too early!
!STACK 0
java.lang.RuntimeException: Widget disposed too early!
	at org.eclipse.ui.internal.WorkbenchPartReference$1.widgetDisposed(WorkbenchPartReference.java:153)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:101)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:933)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:743)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:636)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:746)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:636)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:746)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:636)
	at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:117)
	at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:722)
	at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1062)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:746)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:415)
	at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:397)
	at org.eclipse.swt.widgets.Shell.dispose(Shell.java:627)
	at org.eclipse.jface.window.Window.close(Window.java:330)
	at org.eclipse.jface.window.ApplicationWindow.close(ApplicationWindow.java:299)
	at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1510)
	at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:622)
	at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:598)
	at org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindow.java:713)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:711)
	at org.eclipse.jface.window.WindowManager.close(WindowManager.java:109)
	at org.eclipse.ui.internal.Workbench$12.run(Workbench.java:715)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:712)
	at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:642)
	at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:855)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:853)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:828)
	at org.eclipse.ui.internal.QuitAction.run(QuitAction.java:57)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)

!ENTRY org.eclipse.ui.workbench 4 2 2009-02-04 09:49:30.968
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.ui.internal.activities.Identifier.removeIdentifierListener(Identifier.java:150)
	at org.eclipse.ui.internal.PluginActionContributionItem.unhookListeners(PluginActionContributionItem.java:74)
	at org.eclipse.ui.internal.PluginActionContributionItem.setParent(PluginActionContributionItem.java:89)
	at org.eclipse.jface.action.ContributionManager.itemRemoved(ContributionManager.java:383)
	at org.eclipse.jface.action.ContributionManager.removeAll(ContributionManager.java:441)
	at org.eclipse.ui.internal.ViewPane.removeContributions(ViewPane.java:646)
	at org.eclipse.ui.internal.WorkbenchPartReference.dispose(WorkbenchPartReference.java:645)
	at org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchPage.java:1548)
	at org.eclipse.ui.internal.WorkbenchPage.partRemoved(WorkbenchPage.java:1540)
	at org.eclipse.ui.internal.ViewFactory.releaseView(ViewFactory.java:252)
	at org.eclipse.ui.internal.Perspective.dispose(Perspective.java:240)
	at org.eclipse.ui.internal.WorkbenchPage.dispose(WorkbenchPage.java:1604)
	at org.eclipse.ui.internal.WorkbenchWindow.closeAllPages(WorkbenchWindow.java:748)
	at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1486)
	at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:622)
	at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:598)
	at org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindow.java:713)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:711)
	at org.eclipse.jface.window.WindowManager.close(WindowManager.java:109)
	at org.eclipse.ui.internal.Workbench$12.run(Workbench.java:715)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:712)
	at org.eclipse.ui.internal.Workbench.access$8(Workbench.java:642)
	at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:855)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:853)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:828)
	at org.eclipse.ui.internal.QuitAction.run(QuitAction.java:57)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)


Initially we thought the error is caused by our debug plugin contributed to eclipse. However, after investigation, we had the following observations:

1. The error happens before our debug plugin processes stop, i.e., stop() gets called, which means, the error occurs before our debug plugin can do any cleanup.

2. The error happens even if our debugger has been disconnected (or the launch configuration has been terminated) and even if the terminated launch configuration has been removed from debug view. 

From the above observation, it seems that the error is just caused by widgets created in debug view are not created or release or disposed correctly. 

Thanks for looking into the problem.
Comment 1 Felipe Heidrich CLA 2009-02-04 14:31:01 EST
Not SWT. 

Can you reproduce the problem on Eclipse (without your plugin) ?

Maybe the UI Team has seen this problem before.

Personally I think this is a bug in your product (should close report as not_eclipse). 
Comment 2 Paul Webster CLA 2009-02-04 14:44:12 EST
(In reply to comment #0)
> I work on websphere debug tool which is a produce based on eclipse.
> 
> We find that after our debugger has been launched (no matter if it has been
> disconnected or not before shutting down the workspace), if now we shut down
> the workspace, an error dialog will pop up and the following error will be
> logged in the .log file:

Your version says 3.4.1, but this bug was fixed in 3.4.1 and 3.5 M2 by bug 243209 and dependents

PW



*** This bug has been marked as a duplicate of bug 243209 ***
Comment 3 Yuan Gan CLA 2009-02-05 09:47:02 EST
(In reply to comment #2)
> (In reply to comment #0)
> > I work on websphere debug tool which is a produce based on eclipse.
> > 
> > We find that after our debugger has been launched (no matter if it has been
> > disconnected or not before shutting down the workspace), if now we shut down
> > the workspace, an error dialog will pop up and the following error will be
> > logged in the .log file:
> 
> Your version says 3.4.1, but this bug was fixed in 3.4.1 and 3.5 M2 by bug
> 243209 and dependents
> 
> PW
> 
> 
> 
> *** This bug has been marked as a duplicate of bug 243209 ***
> 

Thanks for pointing out this. I just double checked our product in which this problem occurs. It is still based on 3.2.  Then I tested our lastest version which is based on 3.4 and the problem is gone. Thanks for fixing the bug.