Commit cd264714 authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

adding unload cleanup function to avoid some problems of lost objects, specially on IE8

parent 0c077da2
......@@ -834,8 +834,17 @@
}
};
PushStream.unload = function() {
for ( var i = 0; i < PushStreamManager.length; i++) {
try { PushStreamManager[i].disconnect(); } catch(e){}
}
};
/* make class public */
window.PushStream = PushStream;
window.PushStreamManager = PushStreamManager;
if (window.attachEvent) { window.attachEvent("onunload", PushStream.unload); }
if (window.addEventListener) { window.addEventListener.call(window, "unload", PushStream.unload, false); }
})(window);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment