code: function() {
  
          //clear out layers info and unregister their events
          this.clearLayersArray("base");
          this.clearLayersArray("data");
  
          this.map.events.un({
              buttonclick: this.onButtonClick,
              addlayer: this.redraw,
              changelayer: this.redraw,
              removelayer: this.redraw,
              changebaselayer: this.redraw,
              scope: this
          });
          this.events.unregister("buttonclick", this, this.onButtonClick);
  
          OpenLayers.Control.prototype.destroy.apply(this, arguments);
      }
docs: APIMethod: destroy