-
Notifications
You must be signed in to change notification settings - Fork 68
Description
Memory is not freed when I call the destroy function
Root cause is this line:
$livestamps = $livestamps.not($el);
basically, with .not(), the element isn't removed from the array. $livestamps still holds a reference to the element.
Code to reproduce the problem:
$('#birth').livestamp(new Date('June 18, 1987'));
$('#birth').livestamp('destroy');
$('#birth').livestamp(new Date('June 18, 1987'));
$('#birth').livestamp('destroy');
$('#birth').livestamp(new Date('June 18, 1987'));
$('#birth').livestamp('destroy');
You will notice that value of $livestamps.selector becomes longer and longer
.not().not().not([object Object])
.not().not().not([object Object]).not().not([object Object])
.not().not().not([object Object]).not().not([object Object]).not().not([object Object])