diff options
author | Greg Sheremeta <gshereme@redhat.com> | 2016-04-01 22:15:22 +0300 |
---|---|---|
committer | Chris Rebert <code@chrisrebert.com> | 2016-05-30 03:43:40 +0300 |
commit | f01f3e5f34c1acdd802cc61ea9aae9f9b14169c3 (patch) | |
tree | 73733db78a63129d3bc0af0e74d382dcbf2c7119 /js | |
parent | 846b5781079220752e59db01ffefabeac912e446 (diff) |
Clear tooltip's $element to prevent leaking memory. Fixes #17973
Closes #19659
Diffstat (limited to 'js')
-rw-r--r-- | js/tooltip.js | 9 |
1 files changed, 6 insertions, 3 deletions
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 }) } |