[Pkg-javascript-commits] [sockjs-client] 51/434: XDR can be cleaned up during the callback, so double check if it isn't already cleaned up.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:01 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 bddda4d32540bfe9f290e0395cc0abf3f4c930f7
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Wed Aug 3 18:59:40 2011 +0100

    XDR can be cleaned up during the callback, so double check if it isn't already cleaned up.
---
 lib/utils.js | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/utils.js b/lib/utils.js
index 69c009d..0c96fac 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -92,12 +92,14 @@ utils.createXDR = function(method, url, payload, callback) {
     // IE caches even POSTs
     url += ((url.indexOf('?') === -1) ? '?' : '&') + 't='+utils.random_string(8);
     var cleanup = function() {
-        onerror = xdr.onerror = xdr.ontimeout = xdr.onprogress =
-            xdr.onload = null;
-        try {
-            xdr.abort();
-        } catch (x) {}
-        xdr = callback = null;
+        if (xdr) {
+            onerror = xdr.onerror = xdr.ontimeout = xdr.onprogress =
+                xdr.onload = null;
+            try {
+                xdr.abort();
+            } catch (x) {}
+            xdr = callback = null;
+        }
     };
     var onerror = xdr.ontimeout = xdr.onerror = function() {
         mock_xhr.status = 500;

-- 
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