Destroy shared memory segment
@throws RuntimeException
332224
public function destroy() {
		if (false === shmop_delete($this->shm)) {
			throw new RuntimeException(sprintf('Unable to destroy shared memory segment id: %s', $this->shm));
		}

		$this->destroyed = true;
	}
105767
@Override
    public void destroy()
    {
        if (indexManager != null)
        {
            indexManager.close();
        }
        if (schemaManager != null)
        {
            schemaManager.dropSchema();
        }
        schemaManager = null;
        externalProperties = null;

        for (Object connectionPool : hostPools.values())
        {
            if (connectionPool != null && connectionPool.getClass().isAssignableFrom(ConnectionPool.class))
            {
                ((ConnectionPool) connectionPool).close(true);
            }
        }
        ((CassandraRetryService) hostRetryService).shutdown();
    }
519922
@Override
    public void destroyAllWorkspacesForCurrentThread() {
        ensureThreadExistense();

        List<MemoryWorkspace> workspaces = new ArrayList<>();
        workspaces.addAll(backingMap.get().values());

        for (MemoryWorkspace workspace : workspaces) {
            destroyWorkspace(workspace);
        }

        Nd4j.getMemoryManager().invokeGc();
    }
1108813
public void destroy() throws Exception {
        log.debug("Destroy scope");
        if (hasParent()) {
            parent.removeChildScope(this);
        }
        if (hasHandler()) {
            // Because handler can be null when there is a parent handler
            getHandler().stop(this);
        }
        // kill all child scopes
        for (IBasicScope child : children.keySet()) {
            removeChildScope(child);
            if (child instanceof Scope) {
                ((Scope) child).uninit();
            }
        }
    }
637710
@Override
    public void destroy() {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "destroy", this);

        // check the TSR is active - otherwise we can trigger exceptions when we
        // try to get data out of it.
        if (tsr.getTransactionKey() != null) {
            final Map<String, InstanceAndContext<?>> storage = getStorage(false);

            if (storage != null) {
                try {
                    for (InstanceAndContext<?> entry : storage.values()) {
                        final String id = getContextualId(entry.context);
                        destroyItem(id, entry);
                    }
                } finally {
                    tsr.putResource(TXC_STORAGE_ID, null);
                }
            }
        } else {
            if (tc.isDebugEnabled())
                Tr.debug(tc, "Tran synchronization registry not available, skipping destroy");
        }

        //Fire any observers
        beanManager.fireEvent("Destroying transaction context", destroyedQualifier);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "destroy");
    }
80903
@Override
  public void destroy()
  {
    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    
    try {
      thread.setContextClassLoader(this);
      
      WeakStopListener stopListener = _stopListener;
      _stopListener = null;

      super.destroy();
      
      thread.setContextClassLoader(oldLoader);

      ClassLoader parent = getParent();
      for (; parent != null; parent = parent.getParent()) {
        if (parent instanceof EnvironmentClassLoader) {
          EnvironmentClassLoader loader = (EnvironmentClassLoader) parent;

          loader.removeListener(stopListener);
        }
      }
    } finally {
      thread.setContextClassLoader(oldLoader);
      
      //_owner = null;
      _attributes = null;
      _listeners = null;
      //_scanListeners = null;
      //_stopListener = null;

      /*
      EnvironmentAdmin admin = _admin;
      _admin = null;

      if (admin != null)
        admin.unregister();
        */
    }
  }
1237547
private final void _destroy(final Method logFactoryRelease) {
		for (final Iterator it = this.childrenMap.entrySet().iterator(); it
				.hasNext();) {
			final Map.Entry entry = (Map.Entry) it.next();
			final CClassLoader loader = (CClassLoader) entry.getValue();
			loader._destroy(logFactoryRelease);
			it.remove();
		}

		try {
			// remove ref from commons logging
			logFactoryRelease.invoke(null, new Object[] { this });
		} catch (final Exception e) {
		}

		try {
			// reset parent to system class loader
			final Field parent = ClassLoader.class.getDeclaredField("parent");
			parent.setAccessible(true);
			parent.set(this, ClassLoader.getSystemClassLoader());
			parent.setAccessible(false);
		} catch (final Throwable ignore) {
		}

		this.classesMap.clear();
		for (final Iterator it = this.dllMap.entrySet().iterator(); it
				.hasNext();) {
			final Object element = it.next();
			final Map.Entry entry = (Map.Entry) element;
			if (entry.getValue() instanceof File) {
				((File) entry.getValue()).delete();
			}
		}
		this.cacheMap.clear();
		this.dllMap.clear();
		this.resourcesMap.clear();
		this.config = null;
		this.name = null;
		this.finalizepath = this.path;
		this.path = null;
		//classes
		System.runFinalization();
		System.gc();
	}
1299021
protected void destroy() {
        this.nextSequence = null;
        this.prevSequence = null;
        this.bValue = null;
        this.sValue = null;
        this.buffIndex = -1;
        this.offset = 0;
        this.valueLength = 0;
        this.myHashCode = -1;
        this.lastCRLFBufferIndex = -1;
        this.lastCRLFisCR = false;
        this.lastCRLFPosition = -1;
        this.status = ELEM_ADDED;
        this.myOwner.freeElement(this);
    }
1023087
public void destroy() {
		// Synchronize, in case multiCadiFilters are used.
		synchronized(CadiHTTPManip.noAdditional) {
			if(--count<=0 && httpChecker!=null) {
				httpChecker.destroy();
				httpChecker=null;
				access=null;
				pathExceptions=null;
			}
		}
	}
785441
public synchronized void destroy() throws Throwable {

        try {
            if (m_driverManager != null) {
                if (m_driverManager.getLockManager() != null) {
                    try {
                        writeLocks();
                    } catch (Throwable t) {
                        if (LOG.isErrorEnabled()) {
                            LOG.error(
                                org.opencms.lock.Messages.get().getBundle().key(
                                    org.opencms.lock.Messages.ERR_WRITE_LOCKS_FINAL_0),
                                t);
                        }
                    }
                }
                m_driverManager.destroy();
            }
        } catch (Throwable t) {
            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_DRIVER_MANAGER_CLOSE_0), t);
            }
        }

        m_driverManager = null;
        m_dbContextFactory = null;

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(Messages.INIT_SECURITY_MANAGER_SHUTDOWN_1, this.getClass().getName()));
        }
    }
1331757
public void deleteParts() {
        if (!_parsed)
            return;

        Collection<Part> parts;
        try {
            parts = getParts();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        MultiException err = null;
        for (Part p : parts) {
            try {
                ((MultiPart) p).cleanUp();
            } catch (Exception e) {
                if (err == null)
                    err = new MultiException();
                err.add(e);
            }
        }
        _parts.clear();

        if (err != null)
            err.ifExceptionThrowRuntime();
    }
914662
public void destroy() {
        JmsUtils.closeSession(session);

        if (connection != null) {
            ConnectionFactoryUtils.releaseConnection(connection, endpointConfiguration.getConnectionFactory(), true);
        }
    }
674963
@Override
  public void destroy() {

    ensureParentInitialized();

    // execute Output Mappings (if they exist).
    ensureActivityInitialized();
    if (activity != null && activity.getIoMapping() != null && !skipIoMapping) {
      activity.getIoMapping().executeOutputParameters(this);
    }

    clearExecution();

    super.destroy();

    removeEventSubscriptionsExceptCompensation();
  }
1125390
public void destroy() throws ServletException
    {
        try
        {
            // destroy the filter instance
            _filterState = FILTER_STATE_DESTROYING;
            
			for (int i = 0;(nServicing.get() > 0) && i < 60; i++) {
				try {
					if (i == 0)
					{
						logger.logp(Level.INFO, CLASS_NAME,"destroy", "waiting.to.destroy.filter.[{0}]", _filterName);
					}
					Thread.sleep(1000);
				}
				catch (InterruptedException e) {
					com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e, "com.ibm.ws.webcontainer.servlet.ServletInstance.destroy", "377", this);
				}
			}

			if(_eventSource != null && _eventSource.hasFilterListeners()){
				// LIDB-3598: begin
				_eventSource.onFilterStartDestroy(getFilterEvent());
				// LIDB-3598: end
				_filterInstance.destroy();
				// LIDB-3598: begin
				_eventSource.onFilterFinishDestroy(getFilterEvent());
				// LIDB-3598: end
			}
			else{
				_filterInstance.destroy();
			}

			_filterState = FILTER_STATE_DESTROYED;
			if (null != _managedObject){
			    _managedObject.release();
			}
        }
        catch (Throwable th)
        {
    		if(_eventSource != null && _eventSource.hasFilterErrorListeners()){
	        	FilterErrorEvent errorEvent = getFilterErrorEvent(th);
	        	_eventSource.onFilterDestroyError(errorEvent);
    		}
            com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.destroy", "173", this);
            _filterState = FILTER_STATE_UNAVAILABLE;
            throw new ServletException(MessageFormat.format("Filter [{0}]: could not be destroyed", new Object[] {_filterName}), th);
        }
    }
958965
public static function destroy() : void
    {
        Facade::clearResolvedInstances();

        Facade::setFacadeApplication(null);

        self::setContainer(null);
    }
1139396
public function release() {
        if ($this->isAquired()) {
            if (!sem_remove(self::$hSemaphores[$this->key])) throw new RuntimeException('Cannot remove semaphore for key "'.$this->key.'"');
            unset(self::$hSemaphores[$this->key]);
        }
    }
101896
public void destroy()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "destroy");

        // Iterate over the MQLinks, calling the MQLink component to
        // alert it to destroy resources
        LinkTypeFilter mqLinkFilter = new LinkTypeFilter();
        mqLinkFilter.MQLINK = Boolean.TRUE;
        SIMPIterator itr = linkIndex.iterator(mqLinkFilter);
        while (itr.hasNext())
        {
            MQLinkHandler mqLinkHandler = (MQLinkHandler) itr.next();
            try
            {
                mqLinkHandler.destroy();
            } catch (SIResourceException e)
            {
                // No FFDC code needed

                SibTr.exception(tc, e);

                // The MQLink component will have FFDC'd we'll trace
                // the problem but allow processing to continue
            } catch (SIException e)
            {
                // No FFDC code needed

                SibTr.exception(tc, e);

                // The MQLink component will have FFDC'd we'll trace
                // the problem but allow processing to continue
            }
        }
        itr.finished();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "destroy");
    }