Skip to content

Commit 5fd6b91

Browse files
committed
more memory leak handling
1 parent 0f36ef9 commit 5fd6b91

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

controllers/map-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
var objs = obj.map[groupName];
5656
for (var name in objs) {
5757
if (objs[name] === obj) {
58+
//console.log('Deleting', groupName, obj);
5859
google.maps.event.clearInstanceListeners(obj);
5960
delete objs[name];
6061
}

directives/custom-control.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
var position = options.position;
5353
mapController.map.controls[google.maps.ControlPosition[position]].push(customControlEl);
5454

55+
element.bind('$destroy', function() {
56+
mapController.deleteObject('customControls', customControlEl);
57+
});
5558
};
5659

5760
var customControl = function(Attr2MapOptions, _$compile_, _NgMap_) {

0 commit comments

Comments
 (0)