From 2b44a9f020283cd738c51b344ebe66163de1f5b9 Mon Sep 17 00:00:00 2001 From: Jim Cowart Date: Wed, 23 May 2012 12:30:43 -0400 Subject: [PATCH] Fixed bug where iterating over subscriptions gets thrown 'off by 1' when a handler unsubscribes as part of it's operation --- src/main/LocalBus.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/LocalBus.js b/src/main/LocalBus.js index 8397855..fd7c47d 100644 --- a/src/main/LocalBus.js +++ b/src/main/LocalBus.js @@ -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 ) {