code: function() {
          if (this.layers || this.map) {
              var i, layers = this.layers || this.map.layers;
              for (i=layers.length-1; i>=0; --i) {
                  this.removeLayer({layer: layers[i]});
              }
          }
          if (this.map) {
              this.map.events.un({
                  addlayer: this.addLayer,
                  removeLayer: this.removeLayer,
                  scope: this
              });
          }
          OpenLayers.Control.prototype.destroy.apply(this, arguments);
      }
docs: Method: destroy
  The destroy method is used to perform any clean up before the control
  is dereferenced.  Typically this is where event listeners are removed
  to prevent memory leaks.