1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 11:55:40 +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:
Doug Schaefer 2016-07-04 11:58:58 -04:00
parent ba3f1c00ab
commit 86b80c5e0e

View file

@ -61,13 +61,14 @@ public class TerminalConsoleConnector {
}
}
}
setState(TerminalState.CLOSED);
synchronized (TerminalConsoleConnector.this) {
outThread = null;
}
} catch (IOException e) {
Activator.log(e);
}
synchronized (TerminalConsoleConnector.this) {
outThread = null;
disconnect();
}
}
}
@ -135,7 +136,7 @@ public class TerminalConsoleConnector {
remoteProcess = connection.getService(IRemoteCommandShellService.class)
.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY);
} catch (IOException e) {
Activator.log(e);
disconnect();
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e);
}
}
@ -165,9 +166,13 @@ public class TerminalConsoleConnector {
@Override
protected IStatus run(IProgressMonitor monitor) {
remoteProcess.destroy();
remoteProcess = null;
setState(TerminalState.CLOSED);
return Status.OK_STATUS;
}
}.schedule();
} else {
setState(TerminalState.CLOSED);
}
}