benchmarks/scenarios/ember.js
function destroy(obj) {
    var meta = _emberMetalMeta.peekMeta(obj);
    var node, nodes, key, nodeObject;

    if (meta) {
      _emberMetalMeta.deleteMeta(obj);
      // remove chainWatchers to remove circular references that would prevent GC
      node = meta.readableChains();
      if (node) {
        NODE_STACK.push(node);
        // process tree
        while (NODE_STACK.length > 0) {
          node = NODE_STACK.pop();
          // push children
          nodes = node._chains;
          if (nodes) {
            for (key in nodes) {
              if (nodes[key] !== undefined) {
                NODE_STACK.push(nodes[key]);
              }
            }
          }
          // remove chainWatcher in node object
          if (node._watching) {
            nodeObject = node._object;
            if (nodeObject) {
              _emberMetalChains.removeChainWatcher(nodeObject, node._key, node);
            }
          }
        }
      }
    }
  }
function destroy(obj) {
    var meta = _emberMetalMeta.peekMeta(obj);
    var node, nodes, key, nodeObject;

    if (meta) {
      _emberMetalMeta.deleteMeta(obj);
      // remove chainWatchers to remove circular references that would prevent GC
      node = meta.readableChains();
      if (node) {
        NODE_STACK.push(node);
        // process tree
        while (NODE_STACK.length > 0) {
          node = NODE_STACK.pop();
          // push children
          nodes = node._chains;
          if (nodes) {
            for (key in nodes) {
              if (nodes[key] !== undefined) {
                NODE_STACK.push(nodes[key]);
              }
            }
          }
          // remove chainWatcher in node object
          if (node._watching) {
            nodeObject = node._object;
            if (nodeObject) {
              _emberMetalChains.removeChainWatcher(nodeObject, node._key, node);
            }
          }
        }
      }
    }
  }
function destroy ( obj ) { var meta = _emberMetalMeta . peekMeta ( obj ) ; var node , nodes , key , nodeObject ; if ( meta ) { _emberMetalMeta . deleteMeta ( obj ) ; // remove chainWatchers to remove circular references that would prevent GC node = meta . readableChains ( ) ; if ( node ) { NODE_STACK . push ( node ) ; // process tree while ( NODE_STACK . length > 0 ) { node = NODE_STACK . pop ( ) ; // push children nodes = node . _chains ; if ( nodes ) { for ( key in nodes ) { if ( nodes [ key ] !== undefined ) { NODE_STACK . push ( nodes [ key ] ) ; } } } // remove chainWatcher in node object if ( node . _watching ) { nodeObject = node . _object ; if ( nodeObject ) { _emberMetalChains . removeChainWatcher ( nodeObject , node . _key , node ) ; } } } } } }
Tears down the meta on an object so that it can be garbage collected.
Multiple calls will have no effect.

@method destroy
@for Ember
@param {Object} obj  the object to destroy
@return {void}
@private
Tears down the meta on an object so that it can be garbage collected . Multiple calls will have no effect .