1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

don't use the control if already disposed.

This commit is contained in:
Warren Paul 2008-05-08 23:55:09 +00:00
parent 19b5878bd9
commit 97f1304af9

View file

@ -56,16 +56,17 @@ class ExecutablesContentProvider extends ColumnLabelProvider implements IStructu
protected IStatus run(IProgressMonitor monitor) {
IStatus status = em.refreshExecutables(monitor);
// Are we in the UIThread? If so spin it until we are
// done
if (viewer.getControl().getDisplay().getThread() == Thread.currentThread()) {
viewer.refresh(inputElement);
} else {
viewer.getControl().getDisplay().asyncExec(new Runnable() {
public void run() {
viewer.refresh(inputElement);
}
});
// Are we in the UIThread? If so spin it until we are done
if (!viewer.getControl().isDisposed()) {
if (viewer.getControl().getDisplay().getThread() == Thread.currentThread()) {
viewer.refresh(inputElement);
} else {
viewer.getControl().getDisplay().asyncExec(new Runnable() {
public void run() {
viewer.refresh(inputElement);
}
});
}
}
monitor.done();