Close all open connections and release all set variables
973569
public function connect() 
	{
		if($this->getResource()) {
			$this->close();
		}

		$resource = curl_init();

		curl_setopt($resource,CURLOPT_CONNECTTIMEOUT,$this->getTimeout());
	
		$this->setResource($resource);
		parent::connect();
		return $this;
	}
515325
def close(self):
        
        for pool in self.__pool.values():
            while not pool.empty():
                conn = pool.get_nowait()
                try:
                    self._close(conn)
                except Exception:
                    pass

        # reset the pool size after closing all connections
        self.__poolSize.clear()
1204932
function cleanup()
    {
        // destroy loop variable(s)
        foreach ( $this->LoopVariablesNames as $varName )
            $this->Tpl->unsetVariable( $varName, $this->RootNamespace );
    }
257996
def close_db(fn):
    """"""
    @wraps(fn)
    def inner(*args, **kwargs):
        try:
            return fn(*args, **kwargs)
        finally:
            if not HUEY.immediate:
                close_old_connections()
    return inner
25756
def close(self):
        '''
        '''
        for connection in self.ready:
            connection.close()

        for connection in self.busy:
            connection.close()

        self._closed = True
958665
public void closeAll() {
		for (Object connection : pool.values()) {
			JMXMonConnection jmxcon = (JMXMonConnection)connection;
            if (jmxcon.connector != null) {
                try {
                	jmxcon.connector.close();
                    log.debug("jmx connector is closed");
                } catch (Exception ex) {
                    log.debug("Can't close jmx connector, but continue");
                }
            } else {
                log.debug("jmxConnector == null, don't try to close connection");
            }
            
            jmxcon.connector = null;
            jmxcon = null;
            
        }
		/* erase pool informations for this run but will be recreate for the next run */
		pool.clear();
	}
813297
async def close(self):
        """"""
        conn = self._connection
        if conn is None:
            return
        try:
            while (await self.nextset()):
                pass
        finally:
            self._connection = None
978347
def release(self, connection):
        
        with self.lock:
            connection.in_use = False
            self.cond.notify_all()
398040
def close(self):
        
        if self._closed:
            return
        try:
            with self.lock:
                if not self._closed:
                    self._closed = True
                    for address in list(self.connections):
                        self.remove(address)
        except TypeError as e:
            pass
1330918
public static void closeAll() {
    try { H2O._udpSocket.close(); } catch( IOException e ) { }
    try { H2O._apiSocket.close(); } catch( IOException e ) { }
    try { TCPReceiverThread.SOCK.close(); } catch( IOException e ) { }
  }
780785
final public void close() {
		List<C> connsToClose;
		synchronized(poolLock) {
			// Prevent any new connections
			isClosed = true;
			// Find any connections that are available and open
			connsToClose = new ArrayList<>(availableConnections.size());
			for(PooledConnection<C> availableConnection : availableConnections) {
				synchronized(availableConnection) {
					C conn = availableConnection.connection;
					if(conn!=null) {
						availableConnection.connection = null;
						connsToClose.add(conn);
					}
				}
			}
			poolLock.notifyAll();
		}
		// Close all of the connections
		for(C conn : connsToClose) {
			try {
				close(conn);
			} catch(Exception err) {
				logger.log(Level.WARNING, null, err);
			}
		}
	}
1126501
def _close_connection(self):
        """"""
        if (self._mode == PROP_MODE_SERIAL):
            self._serial.close()
        elif (self._mode == PROP_MODE_TCP):
            self._socket.close()
        elif (self._mode == PROP_MODE_FILE):
            self._file.close()
459598
void closeCurrentConnections() {
        final CountDownLatch latch = new CountDownLatch(hostThreadData.size());
        for(final Map.Entry<XnioIoThread, HostThreadData> data : hostThreadData.entrySet()) {
            data.getKey().execute(new Runnable() {
                @Override
                public void run() {
                    ConnectionHolder d = data.getValue().availableConnections.poll();
                    while (d != null) {
                        IoUtils.safeClose(d.clientConnection);
                        d = data.getValue().availableConnections.poll();
                    }
                    data.getValue().connections = 0;
                    latch.countDown();
                }
            });
        }
        try {
            latch.await(10, TimeUnit.SECONDS);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
486601
final void closeAndRemoveAllDatabaseHandles() {
        for (Database databaseHandle : this.databaseHandles) {
            try {
                databaseHandle.close();
            } catch (EnvironmentFailureException | IllegalStateException ex) {
                LOGGER.log(Level.SEVERE,
                        "Error closing databases", ex);
            }
        }
        this.databaseHandles.clear();
    }
821101
def close_idle_connections(self, pool_id=None):
        """"""
        if not hasattr(self, '_pools'):
            return

        if pool_id:
            if pool_id not in self._pools:
                raise ProgrammingError("pool %r does not exist" % pool_id)
            else:
                pool = self._pools[pool_id]
                pool.close()
        else:
            for pool_id, pool in self._pools.items():
                pool.close()
215514
public void close () {
		Connection[] connections = this.connections;
		for (int i = 0; i < connections.length; i++)
			connections[i].removeListener(invokeListener);

		synchronized (instancesLock) {
			ArrayList<ObjectSpace> temp = new ArrayList(Arrays.asList(instances));
			temp.remove(this);
			instances = temp.toArray(new ObjectSpace[temp.size()]);
		}

		if (TRACE) trace("kryonet", "Closed ObjectSpace.");
	}
393399
def close_all():
    """

    # Windows can be closed by releasing all references to them so they can be
    # garbage collected. May not be necessary to call close().
    global _qtg_windows
    for window in _qtg_windows:
        window.close()
    _qtg_windows = []

    global _qtg_widgets
    for widget in _qtg_widgets:
        widget.close()
    _qtg_widgets = []

    global _plt_figures
    for fig in _plt_figures:
        _, plt, _ = _import_plt()
        plt.close(fig)
    _plt_figures = []