code: function() {
          if (this.features != null) {
              while(this.features.length > 0) {
                  var feature = this.features[0];
                  OpenLayers.Util.removeItem(this.features, feature);
                  feature.destroy();
              }
          }        
      }
docs: Method: clearFeatures
  Destroy all features in this layer.