[Pkg-javascript-commits] [sockjs-client] 398/434: Canceling SockJS before "info" exited caused an exception in IE.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit b2fe9ab9854de6be5bbee8dfe93c7a62451fc4ff
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Tue Apr 24 12:03:45 2012 +0100

    Canceling SockJS before "info" exited caused an exception in IE.
---
 lib/sockjs.js | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/sockjs.js b/lib/sockjs.js
index 5b384f3..731ae15 100644
--- a/lib/sockjs.js
+++ b/lib/sockjs.js
@@ -37,8 +37,9 @@ var SockJS = function(url, dep_protocols_whitelist, options) {
     that._protocols = [];
     that.protocol = null;
     that.readyState = SockJS.CONNECTING;
-    var ir = createInfoReceiver(that._base_url);
-    ir.onfinish = function(info, rtt) {
+    that._ir = createInfoReceiver(that._base_url);
+    that._ir.onfinish = function(info, rtt) {
+        that._ir = null;
         if (info) {
             if (that._options.info) {
                 // Override if user supplies the option
@@ -105,9 +106,15 @@ SockJS.prototype._didClose = function(code, reason, force) {
         that.readyState !== SockJS.OPEN &&
         that.readyState !== SockJS.CLOSING)
             throw new Error('INVALID_STATE_ERR');
-    if (that._transport)
+    if (that._ir) {
+        that._ir.nuke();
+        that._ir = null;
+    }
+
+    if (that._transport) {
         that._transport.doCleanup();
-    that._transport = null;
+        that._transport = null;
+    }
 
     var close_event = new SimpleEvent("close", {
         code: code,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list