Releases the Engine object.
This method is automatically called from #finalize(), but
it's recommended to call this method just after you finish
using the object.
429259
@Override
    public void release() throws EEException {
        LOG.trace("Releasing Execution Engine... " + pointer);
        if (pointer != 0L) {
            final int errorCode = nativeDestroy(pointer);
            pointer = 0L;
            checkErrorCode(errorCode);
        }
        m_firstDeserializer = null;
        m_firstDeserializerBufferOrigin.discard();
        m_nextDeserializer = null;
        m_nextDeserializerBufferOrigin.discard();
        m_exceptionBuffer = null;
        m_exceptionBufferOrigin.discard();
        m_emptyDeserializer = null;
        m_emptyDeserializerBuffer.discard();
        m_psetBufferC.discard();
        m_psetBuffer = null;
        m_perFragmentStatsBufferC.discard();
        m_perFragmentStatsBuffer = null;
        m_udfBufferC.discard();
        m_udfBuffer = null;
        LOG.trace("Released Execution Engine.");
    }
425408
public void release() {
        if (lock != null) {
            try {
                lock.release();
                lock = null;
            } catch (IOException ex) {
                LOGGER.debug("Failed to release lock", ex);
            }
        }
        if (file != null) {
            try {
                file.close();
                file = null;
            } catch (IOException ex) {
                LOGGER.debug("Unable to delete lock file", ex);
            }
        }
        if (lockFile != null && lockFile.isFile()) {
            final String msg = readLockFile();
            if (msg != null && msg.equals(magic) && !lockFile.delete()) {
                LOGGER.error("Lock file '{}' was unable to be deleted. Please manually delete this file.", lockFile.toString());
                lockFile.deleteOnExit();
            }
        }
        lockFile = null;
        removeShutdownHook();
        final Timestamp timestamp = new Timestamp(System.currentTimeMillis());
        LOGGER.debug("Lock released ({}) {} @ {}", Thread.currentThread().getName(), magic, timestamp.toString());
    }
799352
private void release() {
        try {
            Method release = BoundObjectTable.Table.class.getDeclaredMethod("release", String.class);
            release.setAccessible(true);
            release.invoke(boundObjectTable, boundId);
        } catch (Exception x) {
            LOG.log(Level.WARNING, "failed to unbind " + boundId, x);
        }
    }
400209
@Override
    public void close() {
        log.debug("close");
        // spawn a thread to finish up our flv writer work
        boolean locked = false;
        try {
            // try to get a lock within x time
            locked = lock.tryAcquire(500L, TimeUnit.MILLISECONDS);
            if (locked) {
                finalizeFlv();
            }
        } catch (InterruptedException e) {
            log.warn("Exception acquiring lock", e);
        } finally {
            if (locked) {
                lock.release();
            }
            if (executor != null && !executor.isTerminated()) {
                executor.shutdown();
            }
        }
    }
1332214
public synchronized static void destroy() {
    if (isInitialized()) {
      Map<String, ProcessEngine> engines = new HashMap<String, ProcessEngine>(processEngines);
      processEngines = new HashMap<String, ProcessEngine>();

      for (String processEngineName : engines.keySet()) {
        ProcessEngine processEngine = engines.get(processEngineName);
        try {
          processEngine.close();
        } catch (Exception e) {
          log.error("exception while closing {}", (processEngineName == null ? "the default process engine" : "process engine " + processEngineName), e);
        }
      }

      processEngineInfosByName.clear();
      processEngineInfosByResourceUrl.clear();
      processEngineInfos.clear();

      setInitialized(false);
    }
  }
746373
public void destroy() {
		if (configuration != null) L.d(LOG_DESTROY);
		stop();
		configuration.diskCache.close();
		engine = null;
		configuration = null;
	}
111555
def finalize(self):
        
        logger.debug("Finalizing: {}".format(self))
        self.plotItem.scene().sigMouseMoved.disconnect(self.mouseMoved)
        self.plotItem.close()
        self.graphicsLayoutWidget.close()
949917
def finalize(self):
        '''
        
        '''
        self._condition.acquire()
        try:
            if self._nconnections != len(self._pool):
                warnings.warn('finalize() called with unreleased connections', RuntimeWarning, 2)

            while self._pool:
                self._close(self._pool.pop().connection)
            self._nconnections = 0
        finally:
            self._condition.release()
1199417
public function finalize()
    {
        @flock($this->getFileResource(), LOCK_UN);
        @fclose($this->getFileResource());
        @unlink($this->getFileName());
    }
1362337
public void release() {

        this.parent = null;

        this.id = null;
        this.facesJspId = null;
        this.created = false;
        this.bodyContent = null;
        this.isNestedInIterator = false;
        _nextChildIndex = 0;
    }
393283
void close() {
        if (this.project != null) {
            Util.logger().log(Level.FINE, "Closing Protege project {0}",
                    this.projectIdentifier);

            for (Iterator<ProjectListener> itr =
                         this.projectListeners.iterator(); itr.hasNext(); ) {
                this.project.removeProjectListener(itr.next());
                itr.remove();
            }
            try {
                this.project.dispose();
                Util.logger().fine("Done closing connection.");
            } catch (IllegalStateException e) {
                /*
                 * Protege registers a shutdown hook that is removed when
                 * dispose() is called on a project. However, we might call this
                 * method during an already started shutdown process. See
                 * documentation for java.lang.Runtime.removeShutdownHook. This
                 * exception should be harmless, unless there are other reasons
                 * dispose() could throw this exception?
                 */
                Util.logger().fine("Done closing connection.");
            } finally {
                this.project = null;
            }

        }
    }
1006043
def finalize(self):
        
        self.library.finalize.argtypes = []
        self.library.finalize.restype = c_int
        ierr = wrap(self.library.finalize)()
        # always go back to previous directory
        logger.info('cd {}'.format(self.original_dir))
        # This one doesn't work.
        os.chdir(self.original_dir)
        if ierr:
            errormsg = "Finalizing model {engine} failed with exit code {code}"
            raise RuntimeError(errormsg.format(engine=self.engine, code=ierr))
850095
function(){
    // if we are not initialized, don't bother finalizing
    if (!this._isInitialized){ return; }
    this._isInitialized = false;

    Marionette.triggerMethod.call(this, "before:stop");

    // stop the sub-modules; depth-first, to make sure the
    // sub-modules are stopped / finalized before parents
    _.each(this.submodules, function(mod){ mod.stop(); });

    // run the finalizers
    this._finalizerCallbacks.run(undefined,this);

    // reset the initializers and finalizers
    this._initializerCallbacks.reset();
    this._finalizerCallbacks.reset();

    Marionette.triggerMethod.call(this, "stop");
  }
823101
@Override
    public void release() {

        super.release();
        m_file = null;
        m_provider = null;
        m_mode = null;
        m_firstOnPage = false;
        m_manualPlacement = true;
        m_editEmpty = false;
    }
779233
public void forceClose() {
        // Move all elements from usedInstances to unusedInstances in a threadsafe way
        for (final T usedInstance : new ArrayList<>(usedInstances)) {
            if (usedInstances.remove(usedInstance)) {
                unusedInstances.add(usedInstance);
            }
        }
        close();
    }
601208
function finish(e) {
      if (e && e.target !== node) {
        return;
      }

      clearTimeout(timer);
      if (removeListeners) removeListeners();

      (0, _removeClass2.default)(node, className);
      (0, _removeClass2.default)(node, activeClassName);

      if (removeListeners) removeListeners();

      // Usually this optional callback is used for informing an owner of
      // a leave animation and telling it to remove the child.
      if (finishCallback) {
        finishCallback();
      }
    }
206754
protected function cleanup()
    {
        if ($this->resource) {
            proc_terminate($this->resource);
        }

        if (is_resource($this->handle)) {
            fclose($this->handle);
        }

        $this->handle   = null;
        $this->resource = null;
    }