From fc366b73fe5923273e8fced6079c546fd780fc54 Mon Sep 17 00:00:00 2001 From: euzuro Date: Mon, 12 Jun 2006 16:00:00 +0000 Subject: [PATCH] recommitting r574 - the bug was in the OpenLayers.Feature destroy() function, which was not checking to ensure a valid map setting. git-svn-id: http://svn.openlayers.org/trunk/openlayers@576 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Feature.js | 6 ++++-- lib/OpenLayers/Layer/WFS.js | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Feature.js b/lib/OpenLayers/Feature.js index 83b58dda98..82e0db2269 100644 --- a/lib/OpenLayers/Feature.js +++ b/lib/OpenLayers/Feature.js @@ -46,8 +46,10 @@ OpenLayers.Feature.prototype= { destroy: function() { //remove the popup from the map - if (this.popup != null) { - this.layer.map.removePopup(this.popup); + if ((this.layer != null) && (this.layer.map != null)) { + if (this.popup != null) { + this.layer.map.removePopup(this.popup); + } } this.events = null; diff --git a/lib/OpenLayers/Layer/WFS.js b/lib/OpenLayers/Layer/WFS.js index 38ef5b6255..6b1f3d7e8f 100644 --- a/lib/OpenLayers/Layer/WFS.js +++ b/lib/OpenLayers/Layer/WFS.js @@ -47,6 +47,14 @@ OpenLayers.Layer.WFS.prototype = }, + /** + * + */ + destroy: function() { + OpenLayers.Layer.Grid.prototype.destroy.apply(this, arguments); + OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments); + }, + /** * @param {OpenLayers.Bounds} bounds * @param {Boolean} zoomChanged