Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-05-22 11:41:20 -0400
committerUwe Stieber2014-05-22 11:41:50 -0400
commitcb6022f9d3768c0817092c9b49c11b299ef41ce4 (patch)
tree5eacbb76f17e1447c83b7985230cd6d52caa113a
parent1340c69debb8ba43a1f09635b8a3c3f7f8a5aec8 (diff)
downloadorg.eclipse.tcf-cb6022f9d3768c0817092c9b49c11b299ef41ce4.tar.gz
org.eclipse.tcf-cb6022f9d3768c0817092c9b49c11b299ef41ce4.tar.xz
org.eclipse.tcf-cb6022f9d3768c0817092c9b49c11b299ef41ce4.zip
Headless: Avoid triggering an "Unhandled exception in TCF event dispatch thread" if the TCFModelManager is initialized in an headless environment
-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