mb-scrollbar icon indicating copy to clipboard operation
mb-scrollbar copied to clipboard

Memory leak inside mb-scrollbar.js

Open sai571 opened this issue 10 years ago • 2 comments

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);

sai571 avatar Jul 01 '15 19:07 sai571

Ofcourse, you need to namespace the corressponding on() event attaching calls with ".mbscrollbar" namespace.

sai571 avatar Jul 01 '15 19:07 sai571

@sai571 can you please describe your solution in details, or even create a fork?

kotmatpockuh avatar Jul 21 '15 20:07 kotmatpockuh