Skip to content

Commit 7429fc7

Browse files
nsteenbeekcvrebert
authored andcommitted
Tooltip: Destroy $tip, $arrow, $viewport to avoid memory leak
Closes twbs#16039.
1 parent 09f9845 commit 7429fc7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

js/tooltip.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@
440440
clearTimeout(this.timeout)
441441
this.hide(function () {
442442
that.$element.off('.' + that.type).removeData('bs.' + that.type)
443+
if (that.$tip) {
444+
that.$tip.detach()
445+
}
446+
that.$tip = null
447+
that.$arrow = null
448+
that.$viewport = null
443449
})
444450
}
445451

0 commit comments

Comments
 (0)