code: function() {
          var deactivated = false;
          if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this, arguments)) {
              // call the cancel callback if mid-drawing
              if(this.dragging) {
                  this.cancel();
              }
              // If a layer's map property is set to null, it means that that
              // layer isn't added to the map. Since we ourself added the layer
              // to the map in activate(), we can assume that if this.layer.map
              // is null it means that the layer has been destroyed (as a result
              // of map.destroy() for example.
              if (this.layer.map != null) {
                  this.layer.destroy(false);
                  if (this.feature) {
                      this.feature.destroy();
                  }
              }
              this.layer = null;
              this.feature = null;
              deactivated = true;
          }
          return deactivated;
      }
docs: APIMethod: deactivate
  Turn off the handler.
  
  Returns:
  {Boolean} The handler was successfully deactivated