From ff52f52a8d11fa991219160ab293be50d861f902 Mon Sep 17 00:00:00 2001 From: VitalyVoroshilov Date: Mon, 6 Oct 2014 12:55:26 +0400 Subject: [PATCH] fix(tooltip): properly gc popupTimeout - Make sure to cancel timeout before setting to `null` Closes #2786 --- src/tooltip/tooltip.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index 1c266ca7fd..515c59ecd7 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -203,7 +203,10 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position']) // Show the tooltip popup element. function show() { - popupTimeout = null; + if (popupTimeout) { + $timeout.cancel(popupTimeout); + popupTimeout = null; + } // If there is a pending remove transition, we must cancel it, lest the // tooltip be mysteriously removed.