OpenLayers OpenLayers

Changeset 5465

Show
Ignore:
Timestamp:
12/17/07 03:03:01 (1 year ago)
Author:
elemoine
Message:

Subclasses of markers layer should destroy, then clear their list of markers.
Thanks crschmidt for the review. (closes #1123)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/GeoRSS.js

    r5400 r5465  
    7676     */ 
    7777    destroy: function() { 
     78        // Warning: Layer.Markers.destroy() must be called prior to calling 
     79        // clearFeatures() here, otherwise we leak memory. Indeed, if 
     80        // Layer.Markers.destroy() is called after clearFeatures(), it won't be 
     81        // able to remove the marker image elements from the layer's div since 
     82        // the markers will have been destroyed by clearFeatures(). 
     83        OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments); 
    7884        this.clearFeatures(); 
    7985        this.features = null; 
    80         OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments); 
    8186    }, 
    8287         
  • trunk/openlayers/lib/OpenLayers/Layer/Text.js

    r5412 r5465  
    8787     */ 
    8888    destroy: function() { 
     89        // Warning: Layer.Markers.destroy() must be called prior to calling 
     90        // clearFeatures() here, otherwise we leak memory. Indeed, if 
     91        // Layer.Markers.destroy() is called after clearFeatures(), it won't be 
     92        // able to remove the marker image elements from the layer's div since 
     93        // the markers will have been destroyed by clearFeatures(). 
     94        OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments); 
    8995        this.clearFeatures(); 
    9096        this.features = null; 
    91         OpenLayers.Layer.Markers.prototype.destroy.apply(this, arguments); 
    9297    }, 
    9398