Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelManager.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelManager.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelManager.java
index ed7c5fa36..17b4f846f 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelManager.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelManager.java
@@ -154,14 +154,24 @@ public class TCFModelManager {
public TCFModelManager() {
assert Protocol.isDispatchThread();
- PlatformUI.getWorkbench().addWorkbenchListener(workbench_listener);
+ try {
+ PlatformUI.getWorkbench().addWorkbenchListener(workbench_listener);
+ } catch (IllegalStateException e) {
+ // In headless environments the plug-in load can be still triggered.
+ // Should not trigger an "Unhandled exception in TCF event dispatch thread"
+ }
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(debug_launch_listener);
TCFLaunch.addListener(tcf_launch_listener);
}
public void dispose() {
assert Protocol.isDispatchThread();
- PlatformUI.getWorkbench().removeWorkbenchListener(workbench_listener);
+ try {
+ PlatformUI.getWorkbench().removeWorkbenchListener(workbench_listener);
+ } catch (IllegalStateException e) {
+ // In headless environments the plug-in load can be still triggered.
+ // Should not trigger an "Unhandled exception in TCF event dispatch thread"
+ }
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(debug_launch_listener);
TCFLaunch.removeListener(tcf_launch_listener);
for (Iterator<TCFModel> i = models.values().iterator(); i.hasNext();) {

Back to the top