Skip to content

Commit

Permalink
Unbind event listeners on close
Browse files Browse the repository at this point in the history
for uncaught exceptions and rejections. Closes a small memory leak observed in Issue #1706.
  • Loading branch information
wbt authored Jul 7, 2020
1 parent 7b46dc8 commit 34bed86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/winston/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ class Logger extends Transform {
* @returns {Logger} - TODO: add return description.
*/
close() {
this.exceptions.unhandle();
this.rejections.unhandle();
this.clear();
this.emit('close');
return this;
Expand Down

0 comments on commit 34bed86

Please sign in to comment.