Stopped crash on destruction of GeoJSONLayer

master
Robin Hawkes 2016-03-14 22:01:28 +00:00
rodzic a91f5b843e
commit 051ae73543
5 zmienionych plików z 42 dodań i 12 usunięć

23
dist/vizicities.js vendored
Wyświetl plik

@ -14255,6 +14255,18 @@ return /******/ (function(modules) { // webpackBootstrap
this._pickingMesh = null;
}
if (this._polygonMesh) {
this._polygonMesh = null;
}
if (this._polylineMesh) {
this._polylineMesh = null;
}
if (this._pointMesh) {
this._pointMesh = null;
}
// Run common destruction logic from parent
_get(Object.getPrototypeOf(GeoJSONLayer.prototype), 'destroy', this).call(this);
}
@ -14340,11 +14352,14 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'destroy',
value: function destroy() {
for (var i = 0; i < this._layers.length; i++) {
this._layers[i].destroy();
}
// TODO: Sometimes this is already null, find out why
if (this._layers) {
for (var i = 0; i < this._layers.length; i++) {
this._layers[i].destroy();
}
this._layers = null;
this._layers = null;
}
_get(Object.getPrototypeOf(LayerGroup.prototype), 'destroy', this).call(this);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -493,6 +493,18 @@ class GeoJSONLayer extends LayerGroup {
this._pickingMesh = null;
}
if (this._polygonMesh) {
this._polygonMesh = null;
}
if (this._polylineMesh) {
this._polylineMesh = null;
}
if (this._pointMesh) {
this._pointMesh = null;
}
// Run common destruction logic from parent
super.destroy();
}

Wyświetl plik

@ -34,11 +34,14 @@ class LayerGroup extends Layer {
// Destroy the layers and remove them from the scene and memory
destroy() {
for (var i = 0; i < this._layers.length; i++) {
this._layers[i].destroy();
}
// TODO: Sometimes this is already null, find out why
if (this._layers) {
for (var i = 0; i < this._layers.length; i++) {
this._layers[i].destroy();
}
this._layers = null;
this._layers = null;
}
super.destroy();
}