Skip to content

Colossal Memory Leak #18

@ncd76

Description

@ncd76

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions