Skip to content

Commit 733cbf5

Browse files
committed
UI component being attempted to be disposed in a non-ui thread.
Fixes #2316
1 parent 223dfe7 commit 733cbf5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/e4/compatibility/CompatibilityPart.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.eclipse.swt.graphics.Image;
4848
import org.eclipse.swt.layout.FillLayout;
4949
import org.eclipse.swt.widgets.Composite;
50+
import org.eclipse.swt.widgets.Display;
5051
import org.eclipse.ui.IEditorPart;
5152
import org.eclipse.ui.ISaveablePart;
5253
import org.eclipse.ui.IWorkbenchPart;
@@ -420,7 +421,12 @@ public void create() {
420421
@PreDestroy
421422
void destroy() {
422423
if (!alreadyDisposed) {
423-
invalidate();
424+
Display display = Display.getDefault();
425+
if (display != null && !display.isDisposed() && Display.getCurrent() != display) {
426+
display.syncExec(this::invalidate);
427+
} else {
428+
invalidate();
429+
}
424430
}
425431

426432
eventBroker.unsubscribe(widgetSetHandler);

0 commit comments

Comments
 (0)