From: Greg Sheremeta Date: Fri, 1 Apr 2016 19:15:22 +0000 (-0400) Subject: Clear tooltip's $element to prevent leaking memory. Fixes #17973 X-Git-Tag: v3.3.7~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f01f3e5f34c1acdd802cc61ea9aae9f9b14169c3;p=thirdparty%2Fbootstrap.git Clear tooltip's $element to prevent leaking memory. Fixes #17973 Closes #19659 --- diff --git a/js/tooltip.js b/js/tooltip.js index 250e48e5c9..943002199e 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -317,9 +317,11 @@ function complete() { if (that.hoverState != 'in') $tip.detach() - that.$element - .removeAttr('aria-describedby') - .trigger('hidden.bs.' + that.type) + if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. + that.$element + .removeAttr('aria-describedby') + .trigger('hidden.bs.' + that.type) + } callback && callback() } @@ -478,6 +480,7 @@ that.$tip = null that.$arrow = null that.$viewport = null + that.$element = null }) }