Fixed bug where iterating over subscriptions gets thrown 'off by 1' when a handler unsubscribes as part of it's operation

This commit is contained in:
Jim Cowart 2012-05-23 12:30:43 -04:00
parent 6f4436b831
commit 2b44a9f020

View file

@ -35,6 +35,7 @@ var localBus = {
} );
_.each( this.subscriptions[envelope.channel], function ( topic ) {
// TODO: research faster ways to handle this than _.clone
_.each( _.clone(topic), function ( subDef ) {
if ( postal.configuration.resolver.compare( subDef.topic, envelope.topic ) ) {
if ( _.all( subDef.constraints, function ( constraint ) {