code: function() {
          if (this.layer) {
              this.layer.removeFeatures(this);
              this.layer = null;
          }
              
          this.geometry = null;
          this.modified = null;
          OpenLayers.Feature.prototype.destroy.apply(this, arguments);
      }
docs: Method: destroy
  nullify references to prevent circular references and memory leaks