Created
April 3, 2015 12:55
-
-
Save jaw187/cb5266bb3d9b415b37c0 to your computer and use it in GitHub Desktop.
Async Leakageseses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bad = function (options, callback) { | |
var a = options.a; | |
doSomethingAsync(function (err, res) { | |
callback(err, res); | |
}); | |
}; | |
var good = function (options, callback) { | |
var a = options.a; | |
doSomethingAsync(function (err, res) { | |
delete options; | |
delete a; | |
callback(err, res); | |
}); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment