[Commits] r2329 - core/trunk/geoext/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Fri Sep 10 15:58:05 CEST 2010


Author: ahocevar
Date: 2010-09-10 15:58:05 +0200 (Fri, 10 Sep 2010)
New Revision: 2329

Modified:
   core/trunk/geoext/lib/GeoExt/widgets/LayerLegend.js
Log:
don't try to update the LayerLegend while it awaits garbage collection. r=pgiraud (closes #291)


Modified: core/trunk/geoext/lib/GeoExt/widgets/LayerLegend.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/LayerLegend.js	2010-09-10 13:53:40 UTC (rev 2328)
+++ core/trunk/geoext/lib/GeoExt/widgets/LayerLegend.js	2010-09-10 13:58:05 UTC (rev 2329)
@@ -80,7 +80,10 @@
      *  :param operation: ``String`` The type of operation.
      */
     onStoreUpdate: function(store, record, operation) {
-        if(record === this.layerRecord) {
+        // if we don't have items, we are already awaiting garbage
+        // collection after being removed by LegendPanel::removeLegend, and
+        // updating will cause errors
+        if (record === this.layerRecord && this.items.getCount() > 0) {
             var layer = record.getLayer();
             this.setVisible(layer.getVisibility() &&
                 layer.calculateInRange() && layer.displayInLayerSwitcher &&



More information about the Commits mailing list