From 75f922c863a9823e676192641241b1203c286405 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Wed, 8 Sep 2010 13:15:05 +0200 Subject: [PATCH] Avoid missing ref error in WriteStream.prototype.destroy(). --- lib/fs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fs.js b/lib/fs.js index 3f5e270b81..d2293e66a2 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -946,7 +946,9 @@ WriteStream.prototype.forceClose = function (cb) { WriteStream.prototype.destroy = function (cb) { + var self = this; this.writeable = false; + fs.close(self.fd, function(err) { if (err) { if (cb) {