lvlDragDrop icon indicating copy to clipboard operation
lvlDragDrop copied to clipboard

Colossal Memory Leak

Open ncd76 opened this issue 10 years ago • 1 comments

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.

ncd76 avatar Feb 18 '15 12:02 ncd76

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

kevinrenskers avatar Jun 26 '15 17:06 kevinrenskers