Skip to content

Commit

Permalink
deleteHandler now deletes Handlers in addHandlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordin committed Feb 16, 2014
1 parent b8bf697 commit cdfcf7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core.js
Expand Up @@ -2143,6 +2143,12 @@ Strophe.Connection.prototype = {
// this must be done in the Idle loop so that we don't change // this must be done in the Idle loop so that we don't change
// the handlers during iteration // the handlers during iteration
this.removeHandlers.push(handRef); this.removeHandlers.push(handRef);
// If a handler is being deleted while it is being added,
// prevent it from getting added
var i = this.addHandlers.indexOf(handRef);
if (i >= 0) {
this.addHandlers.splice(i, 1);
}
}, },


/** Function: disconnect /** Function: disconnect
Expand Down

0 comments on commit cdfcf7e

Please sign in to comment.