fix memory leak in tooltip $element. Fixes #17973
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/120165154
(Please note that this is a fully automated comment.)
@cvrebert: I think this looks good. Can we merge or is there something else?
@XhmikosR I just wasn't sure (without taking time to trace thru the flow) what situation makes the if necessary.
I'm not sure about the "if" either. The fix seemed to work without that extra "if" in our project, but according to #16451, some people need the extra "if". So I added it in there. It's just extra safety -- I see no harm in leaving it.
Guess we should merge and add a TODO to revisit the "if" later.
@gregsheremeta: can you add the comment?
Clear tooltip's $element to prevent leaking memory. Fixes #17973
Merged as f01f3e5. (Rebased to add the comment in.)
Bookkeeping note: No corresponding patch appears to be required for v4, since it already nullifies the element instance variable upon tooltip destruction: https://github.com/twbs/bootstrap/blob/14c7ba95f97d853ef653893abfe530a919a1ed24/js/src/tooltip.js#L237
When release v3.3.7?
Some time in the next few weeks, most likely. As always, no absolute guarantee though.
The TODO comment is part of the release now.
It looks like this PR is a root cause for #20511
Probably want to add that "if" back in then