code: function() {
          var deactivated = OpenLayers.Control.prototype.deactivate.call(this);
          if(deactivated) {
              for (var i=0, len=this.layers.length; i<len; i++) {
                  var layer = this.layers[i];
                  if (layer && this.clearOnDeactivate === true) {
                      var layerCache = this.layerCache;
                      var selectionLayer = layerCache[layer.id];
                      if (selectionLayer) {
                          layer.events.un({
                              "visibilitychanged": this.coupleLayerVisiblity,
                              scope: selectionLayer});
                          selectionLayer.destroy();
                          delete layerCache[layer.id];
                      }
                  }
              }
          }
          return deactivated;
      }
docs: APIMethod: deactivate
  Deactivate the control. If clearOnDeactivate is true, remove the
  selection layer(s).