Fix #745, including test.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@3299 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -68,8 +68,10 @@ OpenLayers.Layer.Image.prototype =
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
this.tile.destroy();
|
if (this.tile) {
|
||||||
this.tile = null;
|
this.tile.destroy();
|
||||||
|
this.tile = null;
|
||||||
|
}
|
||||||
OpenLayers.Layer.prototype.destroy.apply(this, arguments);
|
OpenLayers.Layer.prototype.destroy.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
function test_99_Layer_Image_destroy_before_use (t) {
|
||||||
|
t.plan(1);
|
||||||
|
var map = new OpenLayers.Map('map');
|
||||||
|
layer = new OpenLayers.Layer.Image('Test', 'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif', new OpenLayers.Bounds(-180, -88.759, 180, 88.759), new OpenLayers.Size(580, 288));
|
||||||
|
map.addLayer(layer);
|
||||||
|
map.removeLayer(layer);
|
||||||
|
layer.destroy();
|
||||||
|
t.ok(true, "destroy() didn't throw an error");
|
||||||
|
}
|
||||||
|
|
||||||
function test_99_Layer_Image_destroy (t) {
|
function test_99_Layer_Image_destroy (t) {
|
||||||
t.plan( 4 );
|
t.plan( 4 );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user