From fb6d2fa55093576e10b5ebaff6b9b2d5b9090460 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 12 Jan 2016 18:57:08 -0800 Subject: [PATCH] GUAC-1452: Input streams must be invalidated when closed. --- .../src/main/webapp/modules/Client.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index dc9c9a02f..bf851a420 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -899,13 +899,20 @@ Guacamole.Client = function(tunnel) { "end": function(parameters) { - // Get stream var stream_index = parseInt(parameters[0]); - var stream = streams[stream_index]; - // Signal end of stream - if (stream && stream.onend) - stream.onend(); + // Get stream + var stream = streams[stream_index]; + if (stream) { + + // Signal end of stream if handler defined + if (stream.onend) + stream.onend(); + + // Invalidate stream + delete streams[stream_index]; + + } },