Skip to content

Commit 9f673f0

Browse files
authored
Unbind event listeners on close (#1824)
for uncaught exceptions and rejections. Closes a small memory leak observed in Issue #1706.
1 parent 7b46dc8 commit 9f673f0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/winston/logger.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,8 @@ class Logger extends Transform {
402402
* @returns {Logger} - TODO: add return description.
403403
*/
404404
close() {
405+
this.exceptions.unhandle();
406+
this.rejections.unhandle();
405407
this.clear();
406408
this.emit('close');
407409
return this;

0 commit comments

Comments
 (0)