Uh oh!
There was an error while loading. Please reload this page.
fs: fix leak of end listener in ReadStream - #1509
Conversation
mscdex
commented
Apr 23, 2015
Has this caused a problem for you? The stream is not re-usable after it ends, so there shouldn't be a need to manually remove listeners. Additionally, using |
coderaiser
commented
Apr 24, 2015
Any way in fs It's about leaking listener, why don't just remove it when it no need? It would simplify work for garbage collector and make code little bit cleaner. I found this when wrote tests for pipe-io module. It simplifies work with streams. I checked that no listeners from this module is leaking to result streams, and found out that node listeners is leaking. |
brendanashworth
commented
May 23, 2015
Sorry for letting this sit for so long. I think it makes sense - LGTM, even if its just theoretical. @mscdex do you have an opinion against this? (I think the |
mscdex
commented
May 23, 2015
@brendanashworth Something very similar to this was already discussed in #1510 and as far as I can tell it was decided it was a non-issue. |
brendanashworth
commented
May 23, 2015
@mscdex wow, that's an impressive drawing. Thanks for enlightening me. This is probably a non-issue too, then. I'll close. Thanks for the pull request, though. |
When read is end, it leaves listener of
endevent.This could be checked this way:
The code will log this function:
Version of
iojsis: