mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
Bug 497254 - Make sure we clean up properly on terminal disconnect.
Both in cases where the disconnect action is invoked, or when the output stream terminates. Change-Id: Icc5e842dc8573a00ce57d726b2878a948e01251d
This commit is contained in:
parent
ba3f1c00ab
commit
86b80c5e0e
1 changed files with 10 additions and 5 deletions
|
@ -61,13 +61,14 @@ public class TerminalConsoleConnector {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setState(TerminalState.CLOSED);
|
|
||||||
synchronized (TerminalConsoleConnector.this) {
|
|
||||||
outThread = null;
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Activator.log(e);
|
Activator.log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
synchronized (TerminalConsoleConnector.this) {
|
||||||
|
outThread = null;
|
||||||
|
disconnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ public class TerminalConsoleConnector {
|
||||||
remoteProcess = connection.getService(IRemoteCommandShellService.class)
|
remoteProcess = connection.getService(IRemoteCommandShellService.class)
|
||||||
.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY);
|
.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Activator.log(e);
|
disconnect();
|
||||||
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
|
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,9 +166,13 @@ public class TerminalConsoleConnector {
|
||||||
@Override
|
@Override
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
remoteProcess.destroy();
|
remoteProcess.destroy();
|
||||||
|
remoteProcess = null;
|
||||||
|
setState(TerminalState.CLOSED);
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
}.schedule();
|
}.schedule();
|
||||||
|
} else {
|
||||||
|
setState(TerminalState.CLOSED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue