Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-04-23 07:53:57 -0400
committerUwe Stieber2014-04-23 07:53:57 -0400
commitc76f302f7316839e2ed2e60f2730060359c26b05 (patch)
treed0b9ce3e368a90051a448a3ab0a0b46b006b8925
parent98b0bf8734e100dded514359af808fe2f63395f2 (diff)
downloadorg.eclipse.tcf-c76f302f7316839e2ed2e60f2730060359c26b05.tar.gz
org.eclipse.tcf-c76f302f7316839e2ed2e60f2730060359c26b05.tar.xz
org.eclipse.tcf-c76f302f7316839e2ed2e60f2730060359c26b05.zip
Target Explorer: Fixed channel closed exception
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
index 8cb876de3..1be0aeeec 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
@@ -197,21 +197,21 @@ public class ProcessLauncher extends PlatformObject implements IProcessLauncher
Runnable runnable = new Runnable() {
@Override
public void run() {
- if (processContext != null && processContext.canTerminate()) {
- // Try to terminate the process the usual way first (sending SIGTERM)
- processContext.terminate(new IProcesses.DoneCommand() {
- @Override
- public void doneCommand(IToken token, Exception error) {
- onTerminateDone(processContext, error);
- }
- });
+ if (channel != null && channel.getState() == IChannel.STATE_OPEN) {
+ if (processContext != null && processContext.canTerminate()) {
+ // Try to terminate the process the usual way first (sending SIGTERM)
+ processContext.terminate(new IProcesses.DoneCommand() {
+ @Override
+ public void doneCommand(IToken token, Exception error) {
+ onTerminateDone(processContext, error);
+ }
+ });
+ }
}
-
}
};
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
+ Protocol.invokeLater(runnable);
}
/* (non-Javadoc)

Back to the top