Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorGreg Sheremeta <gshereme@redhat.com>2016-04-01 22:15:22 +0300
committerChris Rebert <code@chrisrebert.com>2016-05-30 03:43:40 +0300
commitf01f3e5f34c1acdd802cc61ea9aae9f9b14169c3 (patch)
tree73733db78a63129d3bc0af0e74d382dcbf2c7119 /js
parent846b5781079220752e59db01ffefabeac912e446 (diff)
Clear tooltip's $element to prevent leaking memory. Fixes #17973
Closes #19659
Diffstat (limited to 'js')
-rw-r--r--js/tooltip.js9
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
})
}