fix drain() function for "Piping to writable streams from async iterators"
The sample code for "Piping to writable streams from async iterators" is containing an event listener leak, since it registers 2 event listeners, but don't remove them again.
The drain()
function has been changed to remove all the listeners that have been registered within that function in any case again.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines