Skip to content

Commit fd984a7

Browse files
committed
Fix memory leak
This problem was introduced by 8189925 as determined by git bisect: https://gist.github.com/felixge/5567854 Fixes #471
1 parent 81805d1 commit fd984a7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/protocol/sequences/Sequence.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ Sequence.prototype.end = function(err) {
5555
this._addLongStackTrace(err);
5656
}
5757

58+
// Without this we are leaking memory. This problem was introduced in
59+
// 8189925374e7ce3819bbe88b64c7b15abac96b16. I suspect that the error object
60+
// causes a cyclic reference that the GC does not detect properly, but I was
61+
// unable to produce a standalone version of this leak. This would be a great
62+
// challenge for somebody interested in difficult problems : )!
63+
delete this._callSite;
64+
5865
// try...finally for exception safety
5966
try {
6067
if (err) {

0 commit comments

Comments
 (0)