]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Clear tooltip's $element to prevent leaking memory. Fixes #17973
authorGreg Sheremeta <gshereme@redhat.com>
Fri, 1 Apr 2016 19:15:22 +0000 (15:15 -0400)
committerChris Rebert <code@chrisrebert.com>
Mon, 30 May 2016 00:43:40 +0000 (17:43 -0700)
Closes #19659

js/tooltip.js

index 250e48e5c94a41b797ce0a6cbdec7910af74fd5a..943002199e0c635498b4c5c994085b23d02b4438 100644 (file)
 
     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()
     }
 
       that.$tip = null
       that.$arrow = null
       that.$viewport = null
+      that.$element = null
     })
   }