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
}
			
			
			
			if (viewer.getControl().isDisposed()) {
				return Status.CANCEL_STATUS;
			}
			
			
			if (view.getBuilder().isShowingHierarchy()
					&& view.getCategoriesToExpand().isEmpty()) {
				MarkerCategory[] categories = clone.getCategories();
				if (categories != null && categories.length == 1)
					view.getCategoriesToExpand().add(
							categories[0].getDescription());
			}
			if (monitor.isCanceled())
				return Status.CANCEL_STATUS;
			/* 
			 * always use a clone for Thread safety. We avoid setting the clone
			 * as new input as we would offset the benefits of optimization in
			 * TreeViewer.
			 */
			clone = view.createViewerInputClone();
			if (clone == null) {
				
				return Status.CANCEL_STATUS;
			}
			/*
			 * we prefer not to check for cancellation beyond this since we