Skip to content

Commit

Permalink
fix(openlayers.js): Memory leak issue (#394)
Browse files Browse the repository at this point in the history
Set map object to null when controller is destroyed. Was causing memory leaks, Fix for #393
  • Loading branch information
sathishatnet authored and juristr committed Mar 6, 2018
1 parent 6084882 commit 1ac69e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/directives/openlayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ angular.module('openlayers-directive', ['ngSanitize']).directive('openlayers', f

scope.$on('$destroy', function() {
olData.resetMap(attrs.id);
map.setTarget(null);
map = null;
});

// If no layer is defined, set the default tileLayer
Expand Down

0 comments on commit 1ac69e2

Please sign in to comment.