Bug 203327 - Widget is Disposed error after Cancelling a DStore Shell
Summary: Widget is Disposed error after Cancelling a DStore Shell
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-13 13:40 EDT by Kevin Doyle CLA
Modified: 2007-11-08 11:21 EST (History)
1 user (show)

See Also:
mober.at+eclipse: review+


Attachments
patch to use context string instead of context when updating the property sheet (1.11 KB, patch)
2007-09-20 17:04 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Doyle CLA 2007-09-13 13:40:59 EDT
Launch a DStore shell then right click on it in the Systems View and select Cancel Shell.  Get a Widget is Disposed Error.

Error Log:
org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3563)
	at org.eclipse.swt.SWT.error(SWT.java:3481)
	at org.eclipse.swt.SWT.error(SWT.java:3452)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:432)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:325)
	at org.eclipse.swt.widgets.Widget.getData(Widget.java:485)
	at org.eclipse.ui.views.properties.PropertySheetViewer.updateChildrenOf(PropertySheetViewer.java:1229)
	at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:945)
	at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:473)
	at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:214)
	at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156)
	at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62)
	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:857)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
	at org.eclipse.rse.internal.ui.view.SystemView.updatePropertySheet(SystemView.java:5503)
	at org.eclipse.rse.internal.ui.view.SystemView$ResourceChangedJob.runInUIThread(SystemView.java:2047)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
	at org.eclipse.rse.services.dstore.util.DStoreStatusMonitor.waitForUpdate(DStoreStatusMonitor.java:306)
	at org.eclipse.rse.services.dstore.util.DStoreStatusMonitor.waitForUpdate(DStoreStatusMonitor.java:267)
	at org.eclipse.rse.services.dstore.AbstractDStoreService.dsQueryCommand(AbstractDStoreService.java:157)
	at org.eclipse.rse.internal.services.dstore.files.DStoreFileService.getFile(DStoreFileService.java:778)
	at org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem.getFile(FileServiceSubSystem.java:298)
	at org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem.getRemoteFileObject(FileServiceSubSystem.java:220)
	at org.eclipse.rse.internal.subsystems.shells.dstore.DStoreServiceCommandShell.getContext(DStoreServiceCommandShell.java:128)
	at org.eclipse.rse.shells.ui.view.SystemViewRemoteOutputAdapter.getPropertyValue(SystemViewRemoteOutputAdapter.java:1244)
	at org.eclipse.rse.shells.ui.view.SystemViewRemoteOutputAdapter.internalGetPropertyValue(SystemViewRemoteOutputAdapter.java:850)
	at org.eclipse.rse.ui.view.AbstractSystemViewAdapter.getPropertyValue(AbstractSystemViewAdapter.java:753)
	at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:611)
	at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:568)
	at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:760)
	at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:943)
	at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:473)
	at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:214)
	at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156)
	at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62)
	at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:857)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
	at org.eclipse.rse.internal.ui.view.SystemView.updatePropertySheet(SystemView.java:5503)
	at org.eclipse.rse.internal.ui.view.SystemView$ResourceChangedJob.runInUIThread(SystemView.java:2047)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3659)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3296)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1169)

-----------Enter bugs above this line-----------
TM 2.0.1 Testing
installation : eclipse-SDK-3.3
RSE install  : Dev Driver - 
java.runtime : Sun 1.5.0_11-b03
os.name:     : Windows XP, Service Pack 2
------------------------------------------------
Comment 1 Martin Oberhuber CLA 2007-09-13 13:55:42 EDT
Reproduced on Linux easily.

It should be possible to find the issue by placing a breakpoint at SystemView#updatePropertySheet (line 5503).

I consider this minor though since there is no harm except logging the exception.
Comment 2 David McKnight CLA 2007-09-20 17:04:00 EDT
Created attachment 78894 [details]
patch to use context string instead of context when updating the property sheet

I've attached a patch to use the context string instead of the context object when updating the property sheet for a shell.  If getContext() were used, then we would end up doing a query on the main thread.  Because this is on the main thread, the Display.readAndDispatch() gets called while waiting for the query response.  Read and dispatch ends up allowing some refresh events through via the system view and that seems to be what's causing the widget disposed errors.
Comment 3 David McKnight CLA 2007-09-20 17:06:49 EDT
Martin, could you review the patch?  It's a very small change and fairly low-risk. Not sure whether this should wait for 3.0 or go in 2.0.1.
Comment 4 Martin Oberhuber CLA 2007-09-24 11:56:47 EDT
Patch looks good. I'm fine with putting this in 2.0.1 - feel free to check in and I'll retag it.
Comment 5 David McKnight CLA 2007-09-24 12:24:42 EDT
Okay, I've committed the fix to cvs.
Comment 6 Kevin Doyle CLA 2007-11-08 11:21:57 EST
Verified fixed in I20071108.