Destroys a previously started agent using the data in the given object.
343272
public void destroyAgent (AgentObject agent)
    {
        FoundAgent found = resolve(null, agent.getOid(), "destroyAgent");
        if (found == null) {
            return;
        }

        log.info("Destroying agent", "agent", agent.which());

        // transition the agent to a new state and perform the effect of the transition
        if (found.state == AgentState.PENDING) {
            found.bureau.agentStates.remove(found.agent);
            _omgr.destroyObject(found.agent.getOid());

        } else if (found.state == AgentState.STARTED) {
            found.bureau.agentStates.put(found.agent, AgentState.STILL_BORN);

        } else if (found.state == AgentState.RUNNING) {
            // TODO: have a timeout for this in case the client is misbehaving or hung
            BureauSender.destroyAgent(found.bureau.clientObj, agent.getOid());
            found.bureau.agentStates.put(found.agent, AgentState.DESTROYED);

        } else if (found.state == AgentState.DESTROYED ||
            found.state == AgentState.STILL_BORN) {
            log.warning("Ignoring request to destroy agent in unexpected state",
                        "state", found.state, "agent", found.agent.which());
        }

        found.bureau.summarize();
    }
564374
function destroy(unfilteredOptions) {
        const options = this.filterOptions(unfilteredOptions, 'destroy');

        if (!options.destroyBy) {
            options.destroyBy = {
                id: options.id
            };
        }

        // Fetch the object before destroying it, so that the changed data is available to events
        return this.forge(options.destroyBy)
            .fetch(options)
            .then(function then(obj) {
                return obj.destroy(options);
            });
    }
517674
function destroyComponent(instance) {
            if (util.isFn(instance.destroy) && !instance._destroyed) {
                instance.destroy();
                instance._destroyed = true;
            }
        }
956024
private void tearDownObjectsToExecute(final Map<Class<?>, Object> objects,
			final BenchmarkResult res) {

		// executing tearDown for all clazzes registered in given Map
		for (final Class<?> clazz : objects.keySet()) {
			final Object objectToUse = objects.get(clazz);
			if (objectToUse != null) {
				// executing AfterClass for all objects.
				Method afterClassMeth = null;
				try {
					afterClassMeth = BenchmarkMethod
							.findAndCheckAnyMethodByAnnotation(clazz,
									AfterBenchClass.class);
				} catch (final PerfidixMethodCheckException e) {
					res.addException(e);
				}
				// if afterClassMethod exists, the method will be executed and
				// possible failures will be stored in the BenchmarkResult
				if (afterClassMeth != null) {
					final PerfidixMethodCheckException afterByCheck = BenchmarkExecutor
							.checkMethod(objectToUse, AfterBenchClass.class,
									afterClassMeth);
					if (afterByCheck == null) {
						final PerfidixMethodInvocationException afterByInvok = BenchmarkExecutor
								.invokeMethod(objectToUse,
										AfterBenchClass.class, afterClassMeth);
						if (afterByInvok != null) {
							res.addException(afterByInvok);
						}
					} else {
						res.addException(afterByCheck);
					}
				}
			}
		}
	}
2509
def ExpireObject(self, key):
    """"""
    node = self._hash.pop(key, None)
    if node:
      self._age.Unlink(node)
      self.KillObject(node.data)

      return node.data
1325208
def container_destroy(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/destroy' % object_id, input_params, always_retry=always_retry, **kwargs)
169610
public final void destroyRemotely() {
        ClientMessage clientMessage = ClientDestroyProxyCodec.encodeRequest(getDistributedObjectName(), getServiceName());
        try {
            new ClientInvocation(getClient(), clientMessage, getName()).invoke().get();
        } catch (Exception e) {
            throw rethrow(e);
        }
    }
819496
function destroy() {
    var element = this.element;


    if (!getData(element, NAMESPACE)) {
      return this;
    }

    if (this.isImg && this.replaced) {
      element.src = this.originalUrl;
    }

    this.uncreate();
    removeData(element, NAMESPACE);

    return this;
  }
1058539
private void doDelete(Object obj, boolean ignoreReferences) throws PersistenceBrokerException
    {
        //logger.info("DELETING " + obj);
        // object is not null
        if (obj != null)
        {
            obj = getProxyFactory().getRealObject(obj);
            /**
             * Kuali Foundation modification -- 8/24/2007
             */
            if ( obj == null ) return;
            /**
             * End of Kuali Foundation modification
             */
            /**
             * MBAIRD
             * 1. if we are marked for delete already, avoid recursing on this object
             *
             * arminw:
             * use object instead Identity object in markedForDelete List,
             * because using objects we get a better performance. I can't find
             * side-effects in doing so.
             */
            if (markedForDelete.contains(obj))
            {
                return;
            }
            
            ClassDescriptor cld = getClassDescriptor(obj.getClass());
            //BRJ: check for valid pk
            if (!serviceBrokerHelper().assertValidPkForDelete(cld, obj))
            {
                String msg = "Cannot delete object without valid PKs. " + obj;
                logger.error(msg);
                return;
            }
            
            /**
             * MBAIRD
             * 2. register object in markedForDelete map.
             */
            markedForDelete.add(obj);
            Identity oid = serviceIdentity().buildIdentity(cld, obj);

            // Invoke events on PersistenceBrokerAware instances and listeners
            BEFORE_DELETE_EVENT.setTarget(obj);
            fireBrokerEvent(BEFORE_DELETE_EVENT);
            BEFORE_DELETE_EVENT.setTarget(null);

            // now perform deletion
            performDeletion(cld, obj, oid, ignoreReferences);
 	  	 
            // Invoke events on PersistenceBrokerAware instances and listeners
            AFTER_DELETE_EVENT.setTarget(obj);
            fireBrokerEvent(AFTER_DELETE_EVENT);
            AFTER_DELETE_EVENT.setTarget(null);
 	  	 	
            // let the connection manager to execute batch
            connectionManager.executeBatchIfNecessary();
        }
    }
1205998
function destroy(obj) {
    for (var i in obj) {
        if (obj.hasOwnProperty(i) && obj[i]) {
            if ($.isArray(obj[i])) {
                obj[i].length = 0;
            }
            if ($.isFunction(obj[i].destroy)) {
                obj[i].destroy();
            }
            delete obj[i];
        }
    }
}
444448
def remove_object(self, obj):
        """"""
        self._objects.remove(obj)
        self._pairs.difference_update((obj, p) for p in self._properties)
817399
function cleanObject(Object){
    delete Object.resolve;
    delete Object.reject;
    delete Object.resolveResult;
    delete Object.rejectResult;
    delete Object.launchPromise;
    delete Object.promiseFunc;
}
523440
function destroy() {
         // allow recycling object properties
         me.pool.push(this.currentTransform);
         this.currentTransform = undefined;
         me.pool.push(this.anchorPoint);
         this.anchorPoint = undefined;
         me.pool.push(this.pos);
         this.pos = undefined;
         me.pool.push(this._absPos);
         this._absPos = undefined;
         me.pool.push(this._bounds);
         this._bounds = undefined;
         this.onVisibilityChange = undefined;

         if (typeof this.mask !== "undefined") {
           me.pool.push(this.mask);
           this.mask = undefined;
         }

         if (typeof this.tint !== "undefined") {
           me.pool.push(this.tint);
           this.tint = undefined;
         }

         this.ancestor = undefined; // destroy the physic body if defined

         if (typeof this.body !== "undefined") {
           this.body.destroy.apply(this.body, arguments);
           this.body = undefined;
         }

         this.onDestroyEvent.apply(this, arguments);
       }
1270733
function destroy() {
            if (this.__destroyed === true) {
                console.warn('calling on destroyed object');
            }

            this.dispatch('beforeDestroy');
            this._destroy();
            this.dispatch('destroy');

            this.eventListeners = null;
            this.__destroyed    = true;

            return null;
        }
425979
public function destroy()
    {
        // empty
        $_SESSION = array();

        // clear cookies from agent
        $signature = ($this->_name) . 'Signature';
            setcookie(
        $this->_name,
                '',
                time() - 42000,
        $this->_path,
        $this->_host,
        $this->_secure,
        $this->_httponly
            );
            setcookie(
        $signature,
                '',
                time() - 42000,
        $this->_path,
        $this->_host,
        $this->_secure,
        $this->_httponly
            );

        /**
         * Clear out of global scope, since setcookie requires buffer flush
         * to update global <_COOKIE> array.
         */
            unset($_COOKIE[$this->_name]);
            unset($_COOKIE[$signature]);

        // destroy
            session_destroy();
    }
105072
def destroy(name, call=None):
    '''
    
    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'The destroy action must be called with -d, --destroy, '
            '-a or --action.'
        )

    __utils__['cloud.fire_event'](
        'event',
        'destroying instance',
        'salt/cloud/{0}/destroying'.format(name),
        args={'name': name},
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    vmobj = _get_vm_by_name(name)
    if vmobj is not None:
        # stop the vm
        if get_vm_status(vmid=vmobj['vmid'])['status'] != 'stopped':
            stop(name, vmobj['vmid'], 'action')

        # wait until stopped
        if not wait_for_state(vmobj['vmid'], 'stopped'):
            return {'Error': 'Unable to stop {0}, command timed out'.format(name)}

        # required to wait a bit here, otherwise the VM is sometimes
        # still locked and destroy fails.
        time.sleep(3)

        query('delete', 'nodes/{0}/{1}'.format(
            vmobj['node'], vmobj['id']
        ))
        __utils__['cloud.fire_event'](
            'event',
            'destroyed instance',
            'salt/cloud/{0}/destroyed'.format(name),
            args={'name': name},
            sock_dir=__opts__['sock_dir'],
            transport=__opts__['transport']
        )
        if __opts__.get('update_cachedir', False) is True:
            __utils__['cloud.delete_minion_cachedir'](
                name, __active_provider_name__.split(':')[0], __opts__)

        return {'Destroyed': '{0} was destroyed.'.format(name)}
1090340
function () {
            // free some property objects
            if (this.renderable) {
                this.renderable.destroy.apply(this.renderable, arguments);
                this.children.splice(0, 1);
            }

            // call the parent destroy method
            this._super(me.Renderable, "destroy", arguments);
        }