Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-06-22 14:33:06 -0400
committereutarass2011-06-22 14:33:06 -0400
commit020352cf3f921603eeffecbe57f2a8af51a1d50a (patch)
tree9fcdeb9354cf8a6010aa2e5cae1f8df01f8658d4 /plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse
parent126f4d0da4d69fe28df2bcee6785c30a5134af8a (diff)
downloadorg.eclipse.tcf-020352cf3f921603eeffecbe57f2a8af51a1d50a.tar.gz
org.eclipse.tcf-020352cf3f921603eeffecbe57f2a8af51a1d50a.tar.xz
org.eclipse.tcf-020352cf3f921603eeffecbe57f2a8af51a1d50a.zip
TCF Debugger: fixed: exception in display.asyncExec() during unexpected shutdown.
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
index ac2ebda8c..c73c8ceb2 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
@@ -28,6 +28,8 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch;
@@ -44,6 +46,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
private final TCFModel model;
private final TCFLaunch launch;
+ private final Display display;
private final Map<TCFNode,Integer> node2flags = new HashMap<TCFNode,Integer>();
private final Map<TCFNode,TCFNode[]> node2children = new HashMap<TCFNode,TCFNode[]>();
private final Map<TCFNode,ModelDelta> node2delta = new HashMap<TCFNode,ModelDelta>();
@@ -176,6 +179,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
TCFModelProxy(TCFModel model) {
this.model = model;
launch = model.getLaunch();
+ display = model.getDisplay();
}
public void installed(Viewer viewer) {
@@ -349,10 +353,18 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
return delta;
}
+ private void asyncExec(Runnable r) {
+ synchronized (Device.class) {
+ if (!display.isDisposed()) {
+ display.asyncExec(r);
+ }
+ }
+ }
+
private void postDelta(final ModelDelta root) {
assert pending_node == null;
launch.removePendingClient(this);
- model.getDisplay().asyncExec(new Runnable() {
+ asyncExec(new Runnable() {
public void run() {
fireModelChanged(root);
}
@@ -367,7 +379,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
if (getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) {
// Wait until launch manager done creating our launch item in the Debug view.
// Deltas do NOT work without the launch item.
- model.getDisplay().asyncExec(new Runnable() {
+ asyncExec(new Runnable() {
boolean found;
public void run() {
Tree tree = (Tree)getViewer().getControl();

Back to the top