Skip to content

Commit

Permalink
Release zlib callbacks and buffer after processing chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlavin committed May 24, 2016
1 parent dab0987 commit fecc1ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,13 @@ Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {
req.callback = callback;

function callback(availInAfter, availOutAfter) {
if (this) {
// Don't hold onto the buffer and the callback
// after they have been used.
delete this.buffer;
delete this.callback;
}

if (self._hadError)
return;

Expand Down

0 comments on commit fecc1ca

Please sign in to comment.