mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-229: Remove intervals properly when XHR is polling.
This commit is contained in:
@@ -393,7 +393,7 @@ Guacamole.HTTPTunnel = function(tunnelURL, crossDomain) {
|
|||||||
if (pollingMode === POLLING_ENABLED) {
|
if (pollingMode === POLLING_ENABLED) {
|
||||||
if (xmlhttprequest.readyState === 3 && !interval)
|
if (xmlhttprequest.readyState === 3 && !interval)
|
||||||
interval = setInterval(parseResponse, 30);
|
interval = setInterval(parseResponse, 30);
|
||||||
else if (xmlhttprequest.readyState === 4 && !interval)
|
else if (xmlhttprequest.readyState === 4 && interval)
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,7 +461,7 @@ Guacamole.HTTPTunnel = function(tunnelURL, crossDomain) {
|
|||||||
if (length === 0) {
|
if (length === 0) {
|
||||||
|
|
||||||
// Clean up interval if polling
|
// Clean up interval if polling
|
||||||
if (!interval)
|
if (interval)
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
|
||||||
// Clean up object
|
// Clean up object
|
||||||
|
Reference in New Issue
Block a user