Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colossal Memory Leak #18

Open
ncd76 opened this issue Feb 18, 2015 · 1 comment
Open

Colossal Memory Leak #18

ncd76 opened this issue Feb 18, 2015 · 1 comment

Comments

@ncd76
Copy link

ncd76 commented Feb 18, 2015

Hi

In a frequent timer updating the scope with the drag / drops inside a ng-repeat I managed to get 4GB after just 2 mins. Beta that!! :)

lvlDropTarget needs:

scope.$on('$destroy', function() {
drag_start_event();
drag_end_event();
});

with:

var drag_start_event = $rootScope.$on("LVL-DRAG-START", function() {

and

var drag_end_event = $rootScope.$on("LVL-DRAG-END", function() {

I'm not tested it but I think you can also change $rootScope to $scope for those listeners

Either way you end up with huge memory build up with all those listeners on the rootScope unless addresses with one or the other solution.

That's my sight noob Angular take on it anyway.

Nige
PS: Thanks for the code, I hacked it to cope with dragable child elements inside a dropable one.

@kevinrenskers
Copy link

I can confirm the leak and the fix. It's fixed in my fork of lvlDragDrop, see https://github.com/kevinrenskers/lvlDragDrop/pull/3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants