+ Leaflet debug page
+
+
+
+
+
+
+
+
+
+This page will destroy and recreate a map div lots of times. Developer tools shall not display a memory leak.
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/map/Map.js b/src/map/Map.js
index f0c0c162..8dca0f26 100644
--- a/src/map/Map.js
+++ b/src/map/Map.js
@@ -272,6 +272,10 @@ L.Map = L.Evented.extend({
this.fire('unload');
}
+ for (var i in this._layers) {
+ this._layers[i].remove();
+ }
+
return this;
},