In chained tunnel, clear handlers in old tunnel when new tunnel is taking over.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Mon, 19 Mar 2012 22:11:05 +0000 (15:11 -0700)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Mon, 19 Mar 2012 22:11:05 +0000 (15:11 -0700)
src/main/resources/tunnel.js

index b81c418..a35d007 100644 (file)
@@ -707,6 +707,12 @@ Guacamole.ChainedTunnel = function(tunnel_chain) {
      */
     function attach(tunnel) {
 
+        // Clear handlers of current tunnel, if any
+        if (current_tunnel) {
+            current_tunnel.onerror = null;
+            current_tunnel.oninstruction = null;
+        }
+
         // Set own functions to tunnel's functions
         chained_tunnel.disconnect    = tunnel.disconnect;
         chained_tunnel.sendMessage   = tunnel.sendMessage;