0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

Tooltip: Destroy $tip, $arrow, $viewport to avoid memory leak

Closes #16039.
This commit is contained in:
Niels Steenbeek 2015-03-10 15:38:04 +01:00 committed by Chris Rebert
parent 09f98453ce
commit 7429fc7ff9

View File

@ -440,6 +440,12 @@
clearTimeout(this.timeout) clearTimeout(this.timeout)
this.hide(function () { this.hide(function () {
that.$element.off('.' + that.type).removeData('bs.' + that.type) that.$element.off('.' + that.type).removeData('bs.' + that.type)
if (that.$tip) {
that.$tip.detach()
}
that.$tip = null
that.$arrow = null
that.$viewport = null
}) })
} }