Cleans up a given app instance
@method destroy
@param {string} instanceId The Instance ID
438039
function(instanceId) {
			if (_apps[instanceId] && _apps[instanceId].socket) {
				_apps[instanceId].socket.destroy();
			}
			delete _apps[instanceId];
		}
1241572
function beforeFirstCall(instance, method, callback) {
  instance[method] = function() {
    delete instance[method];
    callback.apply(this, arguments);
    return this[method].apply(this, arguments);
  };
}
477589
function(spirit) {
		var all = this._spirits;
		var key = spirit.$instanceid;
		if (!all.inside[key]) {
			if (all.outside[key]) {
				delete all.outside[key];
			}
			all.inside[key] = spirit;
			all.incoming.push(spirit);
			gui.Tick.dispatch(gui.$TICK_INSIDE, 4, this.$contextid);
		}
	}
861513
public static function delete_instance($contextlevel, $instanceid) {
        global $DB;

        // double check the context still exists
        if ($record = $DB->get_record('context', array('contextlevel'=>$contextlevel, 'instanceid'=>$instanceid))) {
            $context = context::create_instance_from_record($record);
            $context->delete();
        } else {
            // we should try to purge the cache anyway
        }
    }
777468
function() {
								jQuery.each(req.apps, function(idx, item) {
									item.name = item.name || item.appId;
									F2.log('Removed failed ' + item.name + ' app', item);
									F2.AppHandlers.__trigger(
										_sAppHandlerToken,
										F2.Constants.AppHandlers.APP_MANIFEST_REQUEST_FAIL,
										item // the app config
									);
									F2.removeApp(item.instanceId);
								});
							}
391769
function (elbName, instanceId, cb) {
      // support removing array of instances at once
      var instance = mapInstances(instanceId),
        params   = { Instances: instance, LoadBalancerName: elbName };
      api.deregisterInstancesFromLoadBalancer(params, cb);
    }
927762
function destroyInstance (instanceId) {
  var instance = instanceOptions[instanceId];
  if (instance && instance.app instanceof instance.Vue) {
    try {
      instance.app.$destroy();
      instance.document.destroy();
    } catch (e) {}
    delete instance.document;
    delete instance.app;
  }
  delete instanceOptions[instanceId];
}
1198032
function cleanup()
    {
      if(chan.timer) clearTimeout(chan.timer);
      chan.timer = setTimeout(function(){
        chan.state = "gone"; // in case an app has a reference
        x.channels[chan.id] = {state:"gone"}; // remove our reference for gc
      }, chan.timeout);
    }
1279626
def delete(cls, app_id):
        
        conn = Qubole.agent()
        return conn.delete(cls.element_path(app_id))
202661
public void deactivateApp(int appId) {
		getResourceFactory().getApiResource("/app/" + appId + "/deactivate")
				.entity(new Empty(), MediaType.APPLICATION_JSON_TYPE).post();
	}
611671
def destroy_ec2(connection, region, instance_id, log=False):
    

    data = get_ec2_info(connection=connection,
                        instance_id=instance_id,
                        region=region)

    instance = connection.terminate_instances(instance_ids=[data['id']])[0]
    if log:
        log_yellow('destroying instance ...')
    while instance.state != "terminated":
        if log:
            log_yellow("Instance state: %s" % instance.state)
        sleep(10)
        instance.update()
    volume_id = data['volume']
    if volume_id:
        destroy_ebs_volume(connection, region, volume_id)
522853
public void destroy(String name, Object instance)
    {
        if (instance != null && isManagedBean(name))
        {
            try
            {
                _lifecycleProvider.destroyInstance(instance);
            } 
            catch (IllegalAccessException e)
            {
                log.log(Level.SEVERE, "Could not access @PreDestroy method of managed bean " + name, e);
            } 
            catch (InvocationTargetException e)
            {
                log.log(Level.SEVERE, "An Exception occured while invoking " +
                        "@PreDestroy method of managed bean " + name, e);
            }
        }
    }
998974
@Override
    public void deleteInstance(String instanceId) {
        modifyInstance(instanceId, map -> {
            Instance deletedInstance = map.remove(instanceId);
            getDeletedInstancesByIdMap().put(deletedInstance.getId(), deletedInstance);
        });
    }
753965
public static void destroyed(String appid){
		if(futureMap.containsKey(appid)){
			futureMap.get(appid).cancel(true);
			logger.info("destroyed appid:{}",appid);
		}
	}
1236229
def destroy(instance_id, call=None):
    '''
    
    '''
    if call == 'function':
        raise SaltCloudSystemExit(
            'The destroy action must be called with -d, --destroy, '
            '-a or --action.'
        )

    instance_data = show_instance(instance_id, call='action')
    name = instance_data['instance_name']

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

    params = {
        'action': 'TerminateInstances',
        'zone': _get_specified_zone(provider=get_configured_provider()),
        'instances.1': instance_id,
    }
    result = query(params)

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

    return result
1023376
function destroy(instance, tx, callback) {
    var
        model = instance.__model,
        sql = utils.format('delete from `%s` where `%s`=?', model.__table, model.__primaryKey),
        params = [instance[model.__primaryKey]];
    smartRunSQL(model.__pool, sql, params, tx, function (err, result) {
        if (err) {
            return callback(err);
        }
        callback(null, instance);
    });
}
450742
@SuppressWarnings("WeakerAccess")
  public void deleteAppProfile(String instanceId, String appProfileId) {
    ApiExceptions.callAndTranslateApiException(deleteAppProfileAsync(instanceId, appProfileId));
  }