char-spinner icon indicating copy to clipboard operation
char-spinner copied to clipboard

Fix event emitter leak by setting listener on process exit only once

Open froucher opened this issue 10 years ago • 2 comments
trafficstars

This PR must resolve errors with eventEmitter memory leaks.

(node) warning: possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at process.addListener (events.js:179:15)
    at process.on.process.addListener (node.js:668:26)
    at spinner (/usr/local/lib/node_modules/gitwalk/node_modules/char-spinner/spin.js:35:13)
    at Object.getUpToDateRefs (/usr/local/lib/node_modules/gitwalk/out/lib/git.js:107:18)

The code was copied from two commits in another fork from atlassian (https://github.com/atlassian/char-spinner/commit/5c31a189019ac284673c88423e3f82714bd16ae2 and https://github.com/atlassian/char-spinner/commit/330819abdbf32b56e6acffb9fd095a83e82be924)

froucher avatar Nov 08 '15 02:11 froucher

Please fix broken tests.

stevenvachon avatar Dec 05 '15 21:12 stevenvachon

@froucher ^

stevenvachon avatar Feb 23 '16 02:02 stevenvachon