[OpenLayers-Trac] [OpenLayers] #1123: OpenLayers.Layer.Markers.destroy() should destroy its markers

OpenLayers trac at openlayers.org
Sun Dec 2 15:17:08 EST 2007


#1123: OpenLayers.Layer.Markers.destroy() should destroy its markers
----------------------------+-----------------------------------------------
  Reporter:  ahocevar       |       Owner:  euzuro     
      Type:  bug            |      Status:  new        
  Priority:  minor          |   Milestone:  2.6 Release
 Component:  Layer.Markers  |     Version:  2.5        
Resolution:                 |    Keywords:  review     
----------------------------+-----------------------------------------------
Comment (by elemoine):

 Some recent thread on users at openlayers.org (<http://www.nabble.com/the-
 right-way-to-refresh-a-text-layer--tf4932706.html>) has made me look at
 this ticket and patch.

 Current code does:

 {{{
     destroy: function() {
         this.clearMarkers();
         this.markers = null;
         OpenLayers.Layer.prototype.destroy.apply(this, arguments);
     },
 }}}

 By emptying the markers array and setting this.markers to null, the
 markers layer releases its references to the markers. So, to me, if the
 creator of the markers doesn't have references to them, they should be
 garbage collected. Please correct me if I'm wrong.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/1123#comment:4>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list