-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release zlib callbacks and buffer after processing chunks #6955
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -574,6 +574,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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no and no, I think… I guess just asking to change the variable instead of asking for the above comment woud have been easier, sorry There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Well, I guess There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mdlavin |
||
this.buffer = null; | ||
this.callback = null; | ||
} | ||
|
||
if (self._hadError) | ||
return; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d like it if there was a comment here saying that
this === req (=== self._handle)