Created
January 6, 2012 19:59
-
-
Save elliotttf/1572145 to your computer and use it in GitHub Desktop.
Memory leak plugged
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
diff --git a/lib/pubhub.js b/lib/pubhub.js | |
index 1878e96..9d22ab8 100644 | |
--- a/lib/pubhub.js | |
+++ b/lib/pubhub.js | |
@@ -152,6 +152,11 @@ PubHub.prototype.fetch = function(options) { | |
console.log('New data found on %s.', feedString); | |
self.emit('changed', data); | |
} | |
+ | |
+ // Explicitly null out the data so it doesn't hang around after we're | |
+ // done with it. | |
+ data = null; | |
+ res = null; | |
}); | |
}); | |
@@ -234,6 +239,8 @@ PubHub.prototype.publishOne = function(subscriber, data) { | |
else { | |
console.log('Published %s to %s.', feedString, subscriberString); | |
clearInterval(retryId); | |
+ retry = null; | |
+ res = null; | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment