lvlDragDrop
lvlDragDrop copied to clipboard
Colossal Memory Leak
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.
I can confirm the leak and the fix. It's fixed in my fork of lvlDragDrop, see https://github.com/kevinrenskers/lvlDragDrop/pull/3.