mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
zlib: release callback and buffer after processing
PR-URL: https://github.com/nodejs/node/pull/6955 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yuval Brik <yuval@brik.org.il>
This commit is contained in:
1 parent
4c423e649c
commit
7d66752f1f
1 file changed
+10
+10
@@ -560,6 +560,16 @@ Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {
|
||||
req.callback = callback;
|
||||
|
||||
function callback(availInAfter, availOutAfter) {
|
||||
// When the callback is used in an async write, the callback's
|
||||
// context is the `req` object that was created. The req object
|
||||
// is === this._handle, and that's why it's important to null
|
||||
// out the values after they are done being used. `this._handle`
|
||||
// can stay in memory longer than the callback and buffer are needed.
|
||||
if (this) {
|
||||
this.buffer = null;
|
||||
this.callback = null;
|
||||
}
|
||||
|
||||
if (self._hadError)
|
||||
return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user