aboutsummaryrefslogtreecommitdiff
path: root/lib/console.js
diff options
context:
space:
mode:
authorVladimir Varankin <nek.narqo+git@gmail.com>2015-10-28 15:56:34 +0300
committercjihrig <cjihrig@gmail.com>2015-11-13 11:36:45 -0500
commita5cce79ec3f0228dd3ff4311022efeb72df21426 (patch)
treea0e17c667e02b9180a2c8e738204eff1a1b7db1c /lib/console.js
parentd9734b7cc958c21d3c086ef6b6f3cb6d9d646570 (diff)
downloadandroid-node-v8-a5cce79ec3f0228dd3ff4311022efeb72df21426.tar.gz
android-node-v8-a5cce79ec3f0228dd3ff4311022efeb72df21426.tar.bz2
android-node-v8-a5cce79ec3f0228dd3ff4311022efeb72df21426.zip
console: delete timers that have ended
Currently, console timers that have been ended with timeEnd() are not removed. This has the potential to leak memory. This commit deletes ended timers from the containing Map. PR-URL: https://github.com/nodejs/node/pull/3562 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com>
Diffstat (limited to 'lib/console.js')
-rw-r--r--lib/console.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/console.js b/lib/console.js
index 531a383876..a0eec4e348 100644
--- a/lib/console.js
+++ b/lib/console.js
@@ -68,6 +68,7 @@ Console.prototype.timeEnd = function(label) {
const duration = process.hrtime(time);
const ms = duration[0] * 1000 + duration[1] / 1e6;
this.log('%s: %sms', label, ms.toFixed(3));
+ this._times.delete(label);
};