Destroys the application instance created by [[mockApplication]].
549056
protected function destroyApplication()
    {
        $this->client->resetPersistentVars();
        if (isset(\Yii::$app) && \Yii::$app->has('session', true)) {
            \Yii::$app->session->close();
        }
        // Close connections if exists
        if (isset(\Yii::$app) && \Yii::$app->has('db', true)) {
            \Yii::$app->db->close();
        }
    }
955995
@Override
    public void destroyApplicationScopeResources(JaxRsModuleMetaData jaxRsModuleMetaData) {

        for (ModuleMetaData mmd : jaxRsModuleMetaData.getEnclosingModuleMetaDatas()) {
            managedObjectFactoryCache.remove(mmd);
            Iterator<ComponentMetaData> iter = beanManagers.keySet().iterator();
            while (iter.hasNext()) {
                ComponentMetaData cmd = iter.next();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "destroyApplicationScopeResources - is " + cmd + " a child of " + mmd + "?");
                }

                if (mmd.equals(cmd.getModuleMetaData())) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "destroyApplicationScopeResources - yes");
                    }
                    iter.remove();
                }
            }
        }
        Bus bus = jaxRsModuleMetaData.getServerMetaData().getServerBus();

        @SuppressWarnings("unchecked")
        Map<String, BeanCustomizerContext> beanCustomizerContexts = (Map<String, BeanCustomizerContext>) bus.getProperty(JaxRsConstants.ENDPOINT_BEANCUSTOMIZER_CONTEXTOBJ);
        if (beanCustomizerContexts == null) {
            return;
        }
        @SuppressWarnings("unchecked")
        Map<Class<?>, ManagedObject<?>> newContext = (Map<Class<?>, ManagedObject<?>>) beanCustomizerContexts.get(createCustomizerKey(this));
        if (newContext == null) {
            return;
        }
        Collection<ManagedObject<?>> objects = newContext.values();
        for (ManagedObject<?> mo : objects) {

            if (mo != null) {
                mo.release();
            }
        }

//destroy application
        ManagedObject<?> appObject = (ManagedObject<?>) jaxRsModuleMetaData.getManagedAppRef();
        if (appObject != null) {
            appObject.release();
        }
    }
1212526
@Override
    public void destroy() {
        //call predestroy
        try {
            webapp.performPreDestroy(wrappedHandler);
        } catch (InjectionException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "destroy  injectionException during preDestroy: ", e);
            }
        }
        wrappedHandler.destroy();
    }
868553
function destroy(appName, callback) {
    commons.del(format('/%s/apps/%s/', deis.version, appName), callback);
  }
716056
public void destroyFaces(ServletContext servletContext)
    {

        FacesContext facesContext = FacesContext.getCurrentInstance();

        if (!WebConfigParamUtils.getBooleanInitParameter(facesContext.getExternalContext(),
                                                         INITIALIZE_ALWAYS_STANDALONE, false))
        {
            //We need to check if the current application was initialized by myfaces
            WebConfigProvider webConfigProvider = WebConfigProviderFactory.getWebConfigProviderFactory(
                    facesContext.getExternalContext()).getWebConfigProvider(facesContext.getExternalContext());

            if (webConfigProvider.getFacesServletMappings(facesContext.getExternalContext()).isEmpty())
            {
                // check to see if the FacesServlet was found by MyFacesContainerInitializer
                Boolean mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_FOUND);

                if (mappingAdded == null || !mappingAdded)
                {
                    // check if the FacesServlet has been added dynamically
                    // in a Servlet 3.0 environment by MyFacesContainerInitializer
                    mappingAdded = (Boolean) servletContext.getAttribute(FACES_SERVLET_ADDED_ATTRIBUTE);

                    if (mappingAdded == null || !mappingAdded)
                    {
                        if (log.isLoggable(Level.WARNING))
                        {
                            log.warning("No mappings of FacesServlet found. Abort destroy MyFaces.");
                        }
                        return;
                    }
                }
            }
        }

        _dispatchApplicationEvent(servletContext, PreDestroyApplicationEvent.class);

        _callPreDestroyOnInjectedJSFArtifacts(facesContext);
        
        // clear the cache of MetaRulesetImpl in order to prevent a memory leak
        MetaRulesetImpl.clearMetadataTargetCache();
        
        // clear UIViewParameter default renderer map
        try
        {
            Class<?> c = Class.forName("javax.faces.component.UIViewParameter");
            Method m = c.getDeclaredMethod("releaseRenderer");
            m.setAccessible(true);
            m.invoke(null);
        }
        catch(ClassNotFoundException e)
        {
            log.log(Level.SEVERE, e.getMessage(), e);
        }
        catch(NoSuchMethodException e)
        {
            log.log(Level.SEVERE, e.getMessage(), e);
        }
        catch(IllegalAccessException e)
        {
            log.log(Level.SEVERE, e.getMessage(), e);
        }
        catch(InvocationTargetException e)
        {
            log.log(Level.SEVERE, e.getMessage(), e);
        }

        // TODO is it possible to make a real cleanup?
    }
267414
@Override
    public void destroy(Exception e) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Destroying inbound link: " + this + " " + getVirtualConnection());
        }
        // if this object is not active, then just return out
        synchronized (this) {
            if (!this.bIsActive) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Ignoring destroy on an inactive object");
                }
                return;
            }
            this.bIsActive = false;
        }
        // 291714 - clean up the statemap
        getVirtualConnection().getStateMap().remove(CallbackIDs.CALLBACK_HTTPICL);
        if (getChannel().getHttpConfig().runningOnZOS()) {
            // 363633 - remove the buffer size value if present
            getVirtualConnection().getStateMap().remove(HttpConstants.HTTPReadBufferSize);
        }
        // now clean out any other app connlinks we may have picked up
        if (null != this.appSides) {
            // the super.destroy without an exception just nulls out values
            // the list of appside connlinks includes the current one
            super.destroy();
            for (ConnectionReadyCallback appside : this.appSides) {
                appside.destroy(e);
            }
            this.appSides = null;
        } else {
            // if we only ever got one connlink above, then call the standard
            // destroy to pass the sequence along
            super.destroy(e);
        }
        this.myInterface.clear();
        this.myInterface.destroy();
        // these are no longer pooled, dereference now
        this.myInterface = null;
        this.myTSC = null;
        this.filterExceptions = false;
        this.numRequestsProcessed = 0;
        this.myChannel = null;
    }
940756
def destroySingleton(cls):
        
        singleton_key = '_{0}__singleton'.format(cls.__name__)
        singleton = getattr(cls, singleton_key, None)
        
        if singleton is not None:
            setattr(cls, singleton_key, None)

            singleton.close()
            singleton.deleteLater()
674621
private void destroySession() {
        currentSessionId = 0;
        setAppLaunchPushed(false);
        getConfigLogger().verbose(getAccountId(),"Session destroyed; Session ID is now 0");
        clearSource();
        clearMedium();
        clearCampaign();
        clearWzrkParams();
    }
1158166
@Override
    public void destroy() throws Exception {

        String thisMethodName = CLASS_NAME + ".destroy()";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, "");
        }

        // Destroy the ME's we created
        Enumeration meEnum = _messagingEngines.elements();

        // Destroy each ME on this server. Any exceptions are caught and
        // deliberately not
        // rethrown as errors in one ME must not affect any others that might
        // exist.
        while (meEnum.hasMoreElements()) {
            Object o = meEnum.nextElement();
            Object c = ((MessagingEngine) o).getRuntime();
            if (c instanceof BaseMessagingEngineImpl) {
                try {
                    ((BaseMessagingEngineImpl) c).destroy();
                    mbeanServiceReg.unregister();
                } catch (Exception e) {
                    FFDCFilter.processException(e, thisMethodName,
                                                "1:910:1.108", this);
                    SibTr.exception(tc, e);
                    SibTr.error(tc, "INTERNAL_ERROR_SIAS0003", e);
                }
            }
        }
        _messagingEngines = null;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName);
        }
    }
233489
public static function destroy() {
		$__run_only_bootstrap = \Application::get('flag.global.__run_only_bootstrap');
		// we need to set working directory again
		chdir(\Application::get('application.path_full'));
		// error processing
		if (empty(\Object\Error\Base::$flag_error_already)) {
			$last_error = error_get_last();
			$flag_render = false;
			if (in_array($last_error['type'], [E_COMPILE_ERROR, E_PARSE, E_ERROR])) {
				\Object\Error\Base::errorHandler($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);
				\Object\Error\Base::$flag_error_already = true;
				$flag_render = true;
			}
			if ($flag_render || \Object\Error\Base::$flag_exception) {
				\Object\Error\Base::$flag_error_already = true;
				if ($__run_only_bootstrap) {
					\Helper\Ob::cleanAll();
					print_r(\Object\Error\Base::$errors);
				} else {
					\Helper\Ob::cleanAll();
					// set mvc + process
					\Object\Error\Base::$flag_database_tenant_not_found = true;
					\Object\Controller\Front::setMvc('/Errors/_Error/500');
					\Application::$controller = new \Controller\Errors();
					\Application::process();
				}
			}
		}
		// final benchmark
		if (\Debug::$debug) {
			\Debug::benchmark('application end');
		}
		// debugging toolbar last
		if (\Debug::$toolbar && !$__run_only_bootstrap) {
			echo str_replace('<!-- [numbers: debug toolbar] -->', \Debug::render(), \Helper\Ob::clean());
		}
		// flush data to client
		flush();
		// closing caches before db
		$cache = \Factory::get(['cache']);
		if (!empty($cache)) {
			foreach ($cache as $k => $v) {
				if (!empty(cache::$reset_caches[$k])) {
					$v['object']->gc(3, cache::$reset_caches[$k]);
				}
				$v['object']->close();
			}
		}
		// destroy i18n
		if (\I18n::$initialized) {
			\I18n::destroy();
		}
		// custom destroy methods
		$temp = \Object\ACL\Resources::getStatic('destroy');
		if (!empty($temp)) {
			foreach ($temp as $v) {
				$method = \Factory::method($v['method'], null, true);
				call_user_func_array($method, []);
			}
		}
		// write sessions
		session_write_close();
		// close db connections
		$dbs = \Factory::get(['db']);
		if (!empty($dbs)) {
			foreach ($dbs as $k => $v) {
				$v['object']->close();
			}
		}
		// emails with erros
		if (\Debug::$debug && !empty(\Debug::$email) && \Application::get('Numbers.Backend', ['backend_exists' => true]) && \Application::get('Numbers.Frontend', ['backend_exists' => true])) {
			\Debug::sendErrorsToAdmin();
		}
	}
236120
public void destroy() {
		clear();
		this.client.operate(null, key, Operation.put(Bin.asNull(binName)));
	}
588305
public synchronized void destroy()
    {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) 
            logger.logp(Level.FINE, CLASS_NAME,"destroy", "entry");

        /*destroying=true;
        
        if (nServicing>0){
        	try {
				this.wait();
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				
			}
        }*/
    	
        super.destroy();

        //parent.removeSubContainer(name);    	//PK37449
    	this.requestMapper = null;
    	this.config = null;
    	this.webApp = null;  // PK25527
        
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) 
        	logger.exiting(CLASS_NAME, "destroy");													//569469
    }
567781
private void deleteApplication() {
        ApplicationDefinition appDef = m_client.getAppDef(m_config.app);
        if (appDef != null) {
            m_logger.info("Deleting existing application: {}", appDef.getAppName());
            m_client.deleteApplication(appDef.getAppName(), appDef.getKey());
        }
    }
1351670
public static void destroy() {
    release();

    INSTANCE.emojiMap.clear();
    INSTANCE.categories = null;
    INSTANCE.emojiPattern = null;
    INSTANCE.emojiRepetitivePattern = null;
    INSTANCE.emojiReplacer = null;
  }
100805
@Override
    public void destroy() {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Destroying ISC: " + this);
        }
        // 291714 - clean up the statemap
        getVC().getStateMap().remove(CallbackIDs.CALLBACK_HTTPISC);
        getVC().getStateMap().remove(HTTP_ERROR_IDENTIFIER);
        this.myLink = null;

        super.destroy();
    }
931327
function destroyInstance (instanceId) {
  var instance = instances[instanceId] || {};
  if (instance.app instanceof Vue$2) {
    instance.app.$destroy();
  }
  delete instances[instanceId];
}
928402
async def destroy_unit(self, *unit_names):
        
        connection = self.connection()
        app_facade = client.ApplicationFacade.from_connection(connection)

        log.debug(
            'Destroying unit%s %s',
            's' if len(unit_names) == 1 else '',
            ' '.join(unit_names))

        return await app_facade.DestroyUnits(list(unit_names))