Use ol.Disposable instead of goog.Disposable

This commit is contained in:
Tim Schaub
2016-03-01 23:58:36 -07:00
parent ae4d8195c0
commit 09eee46822
7 changed files with 67 additions and 30 deletions
+30
View File
@@ -0,0 +1,30 @@
goog.provide('ol.Disposable');
/**
* Objects that need to clean up after themselves.
* @constructor
*/
ol.Disposable = function() {};
/**
* The object has already been disposed.
* @type {boolean}
* @private
*/
ol.Disposable.prototype.disposed_ = false;
/**
* Clean up.
*/
ol.Disposable.prototype.dispose = function() {
if (!this.disposed_) {
this.disposed_ = true;
this.disposeInternal();
}
};
/**
* Extension point for disposable objects.
* @protected
*/
ol.Disposable.prototype.disposeInternal = function() {};