Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 41c40f6

Browse files
committed
fix leak on duplicate subscription - share#260
1 parent 88bb142 commit 41c40f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Agent.prototype._subscribeToStream = function(collection, id, stream) {
105105
stream.on('end', function() {
106106
// The op stream is done sending, so release its reference
107107
var streams = agent.subscribedDocs[collection];
108-
if (!streams) return;
108+
if (!streams || streams[id] !== stream) return;
109109
delete streams[id];
110110
if (util.hasKeys(streams)) return;
111111
delete agent.subscribedDocs[collection];

0 commit comments

Comments
 (0)