diff --git a/guacamole-common-js/src/main/resources/tunnel.js b/guacamole-common-js/src/main/resources/tunnel.js index b81c418d3..a35d0070b 100644 --- a/guacamole-common-js/src/main/resources/tunnel.js +++ b/guacamole-common-js/src/main/resources/tunnel.js @@ -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;