mb-scrollbar
mb-scrollbar copied to clipboard
Memory leak inside mb-scrollbar.js
I think you need to off() the event handlers on document. Line 238, I added the below code in my version, also you need to unregister the MutationObservers.
//Remove previous handler attachments
angular.element(document).off('.mbscrollbar');
//And also remove the event handlers on $destroy
scope.$on('$destroy', function() {
angular.element(document).off('.mbscrollbar');
});
These event handlers also should be removed.
child.on('DOMNodeInserted', recalculate); child.on('DOMNodeRemoved', recalculate);
Ofcourse, you need to namespace the corressponding on() event attaching calls with ".mbscrollbar" namespace.
@sai571 can you please describe your solution in details, or even create a fork?