stream: don't call `cleanup` twice on `end` and `close`
authorMaciej Małecki <maciej.malecki@notimplemented.org>
Sun, 27 May 2012 21:29:00 +0000 (23:29 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Sun, 27 May 2012 23:35:36 +0000 (01:35 +0200)
lib/stream.js

index d6da252..6004163 100644 (file)
@@ -63,9 +63,6 @@ Stream.prototype.pipe = function(dest, options) {
     if (didOnEnd) return;
     didOnEnd = true;
 
-    // remove the listeners
-    cleanup();
-
     dest.end();
   }
 
@@ -74,9 +71,6 @@ Stream.prototype.pipe = function(dest, options) {
     if (didOnEnd) return;
     didOnEnd = true;
 
-    // remove the listeners
-    cleanup();
-
     dest.destroy();
   }