Proper destruction.
This commit is contained in:
@@ -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);
|
||||
};
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user