joyent/node — pull request #3759 by dominictarr (2012-07-24 14:49:42+00:00)
Title: Emit 'close' on destroy(), so that pipe is cleaned up

This patch emits 'close' when you call destroy on a zlib stream.

For pipe to end properly, `destroy` needs to eventually emit 'close' once.

This is necessary is order to properly clean up any pipes that come off the stream.
pipe's event listeners will be cleaned up, and the call to destroy() will be propagated down the piped streams,
by calling `dest.destroy()`.

If close is not emitted, the rest of the stream will be expecting another call to `write()` or `end()` but it will never come.