From c75fe00c51963f9904f2feef347ec75586589b26 Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Wed, 16 Apr 2008 13:44:12 +0000 Subject: [PATCH] [227320] Fix endless loop in SshTerminalShell --- .../ssh/terminal/SshTerminalShell.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java index a8f569305af..b741c3dac47 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/terminal/SshTerminalShell.java @@ -8,6 +8,7 @@ * Contributors: * Martin Oberhuber (Wind River) - initial API and implementation * Anna Dushistova (MontaVista) - [170910] Integrate the TM Terminal View with RSE + * Martin Oberhuber (Wind River) - [227320] Fix endless loop in SshTerminalShell *******************************************************************************/ package org.eclipse.rse.internal.services.ssh.terminal; @@ -193,8 +194,22 @@ public class SshTerminalShell extends AbstractTerminalShell { public void exit() { if (fChannel != null) { - fChannel.disconnect(); - isActive(); + try { + try { + getInputStream().close(); + } catch (IOException ioe) { + /* ignore */ + } + try { + getOutputStream().close(); + } catch (IOException ioe) { + /* ignore */ + } + fChannel.disconnect(); + } finally { + fChannel = null; + isActive(); + } } }