Skip to content

Commit

Permalink
Unregister ObserveMultiplexer before stop
Browse files Browse the repository at this point in the history
It's maybe possible that stop() yields, and in general is more complex.
Since the ObserveMultiplexer is already at the point where it will not
be able to start running again, we should remove it from the registry
first.
  • Loading branch information
glasser committed Feb 7, 2015
1 parent 9166de3 commit 8e8ee3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mongo/mongo_driver.js
Expand Up @@ -1094,8 +1094,8 @@ MongoConnection.prototype._observeChanges = function (
multiplexer = new ObserveMultiplexer({
ordered: ordered,
onStop: function () {
observeDriver.stop();
delete self._observeMultiplexers[observeKey];
observeDriver.stop();
}
});
self._observeMultiplexers[observeKey] = multiplexer;
Expand Down

0 comments on commit 8e8ee3e

Please sign in to comment.