Skip to content

Commit

Permalink
fix(changestream): removes all event listeners on close
Browse files Browse the repository at this point in the history
Fixes Node-1727
  • Loading branch information
Rosemary Yin authored and daprahamian committed Aug 13, 2019
1 parent dc1387e commit 30eeeb5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/change_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class ChangeStream extends EventEmitter {

// Tidy up the existing cursor
var cursor = this.cursor;
['data', 'close', 'end', 'error'].forEach(event => this.cursor.removeAllListeners(event));
delete this.cursor;
return cursor.close(callback);
}
Expand Down

0 comments on commit 30eeeb5

Please sign in to comment.