Skip to content

Commit

Permalink
Make sure cleanUp in CORS transport can safely be re-called.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoglan committed Oct 15, 2011
1 parent a4f5fcc commit 70eb1ed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions javascript/transport/cors.js
Expand Up @@ -8,9 +8,11 @@ Faye.Transport.CORS = Faye.extend(Faye.Class(Faye.Transport, {
xhr.open('POST', this._endpoint, true);

var cleanUp = function() {
if (!xhr) return false;
xhr.onload = xhr.onerror = xhr.ontimeout = xhr.onprogress = null;
xhr = null;
Faye.ENV.clearTimeout(timer);
return true;
};

xhr.onload = function() {
Expand Down

0 comments on commit 70eb1ed

Please sign in to comment.