Disposable Extends Object
Class that provides the basic implementation for disposable objects. If your class holds one or more references to COM objects, DOM nodes, or other disposable objects, it should extend this class or implement the disposable interface (defined in goog.disposable.IDisposable).

Inheritance

Constructor

goog.Disposable()

Instance Methods

Public Protected Private
dispose()
undefined
Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: 
undefined
  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' disposeInternal method. Everywhere else the public dispose method must be used. For example:
mypackage.MyClass = function() {
goog.base(this);
// Constructor logic specific to MyClass.
...
};
goog.inherits(mypackage.MyClass, goog.Disposable);

mypackage.MyClass.prototype.disposeInternal = function() {
goog.base(this, 'disposeInternal');
// Dispose logic specific to MyClass.
...
};
code »
getDisposed()
Use #isDisposed instead. No description.
Returns:   Whether the object has been disposed of.
code »
isDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable :
that will be disposed when this object is disposed.
code »

Instance Properties

dependentDisposables_ :
(Array | null)
Disposables that should be disposed when this object is disposed.
Code »
disposed_ :
Whether the object has been disposed of.
Code »

Static Methods

goog.Disposable.call()
No description.
code »
goog.Disposable.clearUndisposedObjects()
Clears the registry of undisposed objects but doesn't dispose of them.
code »
goog.Disposable.getUndisposedObjects()
No description.
Returns:   All goog.Disposable objects that haven't been disposed of.
code »

Static Properties

goog.Disposable.instances_ :
Maps the unique ID of every undisposed goog.Disposable object to the object itself.
Code »

Package Disposable

Package Reference