Skip to content

Commit 1a769bc

Browse files
committed
zlib: destroy only when both readable and writable finished
1 parent f8f2089 commit 1a769bc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/zlib.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function ZlibBase(opts, mode, handle, { flush, finishFlush, fullFlush }) {
260260
}
261261
}
262262

263-
Transform.call(this, { autoDestroy: false, ...opts });
263+
Transform.call(this, { autoDestroy: true, ...opts });
264264
this._hadError = false;
265265
this.bytesWritten = 0;
266266
this._handle = handle;
@@ -274,7 +274,6 @@ function ZlibBase(opts, mode, handle, { flush, finishFlush, fullFlush }) {
274274
this._defaultFlushFlag = flush;
275275
this._finishFlushFlag = finishFlush;
276276
this._defaultFullFlushFlag = fullFlush;
277-
this.once('end', this.close);
278277
this._info = opts && opts.info;
279278
}
280279
ObjectSetPrototypeOf(ZlibBase.prototype, Transform.prototype);

0 commit comments

Comments
 (0)