diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index f19b437060..de188a5e94 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -1,6 +1,8 @@ goog.provide('ol.control'); goog.provide('ol.control.Control'); +goog.require('goog.object'); + /** * @enum {Object} @@ -75,4 +77,9 @@ ol.control.Control.prototype.deactivate = function() { var returnValue = this.active_; this.active_ = true; return returnValue; +}; + +ol.control.Control.prototype.destroy = function() { + this.deactivate(); + goog.object.clear(this); }; \ No newline at end of file diff --git a/src/ol/event/Drag.js b/src/ol/event/Drag.js index a5df4b05c4..73075e9a03 100644 --- a/src/ol/event/Drag.js +++ b/src/ol/event/Drag.js @@ -1,8 +1,8 @@ goog.provide('ol.event.Drag'); -goog.require('ol.event.ISequence'); goog.require('ol.event'); -goog.require('goog.object'); +goog.require('ol.event.ISequence'); + goog.require('goog.fx.Dragger'); goog.require('goog.fx.DragEvent'); goog.require('goog.fx.Dragger.EventType'); @@ -74,7 +74,7 @@ ol.event.Drag = function(target) { /** @inheritDoc */ ol.event.Drag.prototype.destroy = function() { this.dragger_.dispose(); - goog.object.clear(this); + delete this.dragger_; }; diff --git a/src/ol/event/Scroll.js b/src/ol/event/Scroll.js index 0f499cac0a..472dced4c9 100644 --- a/src/ol/event/Scroll.js +++ b/src/ol/event/Scroll.js @@ -2,6 +2,7 @@ goog.provide('ol.event.Scroll'); goog.require('ol.event.ISequence'); goog.require('ol.event'); + goog.require('goog.events.MouseWheelHandler'); @@ -37,6 +38,7 @@ ol.event.Scroll = function(target) { /** @inheritDoc */ ol.event.Scroll.prototype.destroy = function() { this.handler_.dispose(); + delete this.handler_; };