aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2009-01-06 18:27:07 +0000
committerKenny Root <kenny@the-b.org>2009-01-06 18:27:07 +0000
commit300b642b98bf8e6642e4e20a332e74fa62ee7e88 (patch)
treec21c448bb739cf202e30ae8b5fac2f16445e9b4b
parentf0608055043032691bb8bd4ec0186df8d721533d (diff)
downloadconnectbot-300b642b98bf8e6642e4e20a332e74fa62ee7e88.tar.gz
connectbot-300b642b98bf8e6642e4e20a332e74fa62ee7e88.tar.bz2
connectbot-300b642b98bf8e6642e4e20a332e74fa62ee7e88.zip
Only remove bridge after we get an answer from the user if applicable
-rw-r--r--src/org/connectbot/service/TerminalBridge.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/org/connectbot/service/TerminalBridge.java b/src/org/connectbot/service/TerminalBridge.java
index d198db4..e6fda28 100644
--- a/src/org/connectbot/service/TerminalBridge.java
+++ b/src/org/connectbot/service/TerminalBridge.java
@@ -496,7 +496,7 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal
* Convenience method for writing a line into the underlying MUD buffer.
* Should never be called once the session is established.
*/
- protected void outputLine(String line) {
+ protected synchronized void outputLine(String line) {
if (session != null)
Log.e(TAG, "Session established, cannot use outputLine!", new IOException("outputLine call traceback"));
@@ -663,17 +663,14 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal
if (immediate)
awaitingClose = true;
- // pass notification back up to terminal manager
- // the manager will do any gui notification if applicable
- if(disconnectListener != null)
- disconnectListener.onDisconnected(this);
-
if (!immediate) {
new Thread(new Runnable() {
public void run() {
boolean result = promptHelper.requestBooleanPrompt("Host has disconnected.\nClose session?");
if (result) {
awaitingClose = true;
+
+ // Tell the TerminalManager that we can be destroyed now.
if (disconnectListener != null)
disconnectListener.onDisconnected(TerminalBridge.this);
}
@@ -985,8 +982,9 @@ public class TerminalBridge implements VDUDisplay, OnKeyListener, InteractiveCal
// redraw local output if we don't have a sesson to receive our resize request
if (session == null) {
- ((vt320) buffer).reset();
synchronized (localOutput) {
+ ((vt320) buffer).reset();
+
for (String line : localOutput)
((vt320) buffer).putString(line);
}