Permalink
Browse files

deleteHandler now deletes Handlers in addHandlers

  • Loading branch information...
1 parent b8bf697 commit cdfcf7ec37c7bfb55d98fb2a5289fb84a12a10b8 @Gordin Gordin committed Feb 16, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core.js
View
@@ -2143,6 +2143,12 @@ Strophe.Connection.prototype = {
// this must be done in the Idle loop so that we don't change
// the handlers during iteration
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

0 comments on commit cdfcf7e

Please sign in to comment.