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

Terminal: Fix SWT widget disposed exception on shutdown if terminal is

still open
This commit is contained in:
Uwe Stieber 2014-04-09 07:56:05 +02:00
parent d1c5c40a18
commit c2e7aaa652

View file

@ -1104,7 +1104,7 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
private void runAsyncInDisplayThread(Runnable runnable) { private void runAsyncInDisplayThread(Runnable runnable) {
if(Display.findDisplay(Thread.currentThread())!=null) if(Display.findDisplay(Thread.currentThread())!=null)
runnable.run(); runnable.run();
else if(PlatformUI.isWorkbenchRunning()) else if(PlatformUI.isWorkbenchRunning() && PlatformUI.getWorkbench().getDisplay() != null && !PlatformUI.getWorkbench().getDisplay().isDisposed())
PlatformUI.getWorkbench().getDisplay().asyncExec(runnable); PlatformUI.getWorkbench().getDisplay().asyncExec(runnable);
// else should not happen and we ignore it... // else should not happen and we ignore it...
} }