Fix memory leak in AttachBody
The `$dropdownContainer` variable wasn't being cleaned up when Select2 was destroyed, which was causing a memory leak. This closes https://github.com/select2/select2/issues/3559. This closes https://github.com/select2/select2/pull/3603.
This commit is contained in:
parent
7bc9387de2
commit
671f5a2ce2
6
src/js/select2/dropdown/attachBody.js
vendored
6
src/js/select2/dropdown/attachBody.js
vendored
@ -44,6 +44,12 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
AttachBody.prototype.destroy = function (decorated) {
|
||||
decorated.call(this);
|
||||
|
||||
this.$dropdownContainer.remove();
|
||||
};
|
||||
|
||||
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
|
||||
// Clone all of the container classes
|
||||
$dropdown.attr('class', $container.attr('class'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user