Proper destruction.
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
goog.provide('ol.control');
|
goog.provide('ol.control');
|
||||||
goog.provide('ol.control.Control');
|
goog.provide('ol.control.Control');
|
||||||
|
|
||||||
|
goog.require('goog.object');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {Object}
|
* @enum {Object}
|
||||||
@@ -76,3 +78,8 @@ ol.control.Control.prototype.deactivate = function() {
|
|||||||
this.active_ = true;
|
this.active_ = true;
|
||||||
return returnValue;
|
return returnValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ol.control.Control.prototype.destroy = function() {
|
||||||
|
this.deactivate();
|
||||||
|
goog.object.clear(this);
|
||||||
|
};
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
goog.provide('ol.event.Drag');
|
goog.provide('ol.event.Drag');
|
||||||
|
|
||||||
goog.require('ol.event.ISequence');
|
|
||||||
goog.require('ol.event');
|
goog.require('ol.event');
|
||||||
goog.require('goog.object');
|
goog.require('ol.event.ISequence');
|
||||||
|
|
||||||
goog.require('goog.fx.Dragger');
|
goog.require('goog.fx.Dragger');
|
||||||
goog.require('goog.fx.DragEvent');
|
goog.require('goog.fx.DragEvent');
|
||||||
goog.require('goog.fx.Dragger.EventType');
|
goog.require('goog.fx.Dragger.EventType');
|
||||||
@@ -74,7 +74,7 @@ ol.event.Drag = function(target) {
|
|||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
ol.event.Drag.prototype.destroy = function() {
|
ol.event.Drag.prototype.destroy = function() {
|
||||||
this.dragger_.dispose();
|
this.dragger_.dispose();
|
||||||
goog.object.clear(this);
|
delete this.dragger_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ goog.provide('ol.event.Scroll');
|
|||||||
|
|
||||||
goog.require('ol.event.ISequence');
|
goog.require('ol.event.ISequence');
|
||||||
goog.require('ol.event');
|
goog.require('ol.event');
|
||||||
|
|
||||||
goog.require('goog.events.MouseWheelHandler');
|
goog.require('goog.events.MouseWheelHandler');
|
||||||
|
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ ol.event.Scroll = function(target) {
|
|||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
ol.event.Scroll.prototype.destroy = function() {
|
ol.event.Scroll.prototype.destroy = function() {
|
||||||
this.handler_.dispose();
|
this.handler_.dispose();
|
||||||
|
delete this.handler_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user