Bug 307858 [Markers] UIUpdateJob may throw SWTException if control has been disposed
The runInUIThread(IProgressMonitor) method looks something like this... try { /* ... */ if (viewer.getControl().isDisposed()) { return Status.CANCEL_STATUS; } /* ... */ } finally { viewer.getTree().setRedraw(true); /* ... */ } The problem here is that the 'finally' block gets executed if the control is disposed. Since the control has been disposed, the setRedraw(boolean) invocation throws an SWTException. 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:467) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340) at org.eclipse.swt.widgets.Tree.setRedraw(Tree.java:4734) at org.eclipse.ui.internal.views.markers.UIUpdateJob.runInUIThread(UIUpdateJob.java:120) at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/UIUpdateJob.java
* have to show correct marker counts on UI, not an updating message.
			 */
			IContentProvider contentProvider = viewer.getContentProvider();
			contentProvider.inputChanged(viewer, view.getViewerInput(), clone);
			viewer.getTree().setRedraw(false);
			viewer.refresh(true);
			if (!monitor.isCanceled()) {
				
				view.reexpandCategories();
			}
			if (view.getBuilder().readChangeFlags()[0]) {
				
			}
			
			view.updateTitle();
			lastUpdateTime = System.currentTimeMillis();
		} finally {
			viewer.getTree().setRedraw(true);
			view.updateStatusLine((IStructuredSelection) viewer.getSelection());
			
			updating = false;
		}
		monitor.done();
		return Status.OK_STATUS;
	}
	/**
	 * @return Returns true if updating.
	 */
	boolean isUpdating() {
		return updating;