Release allocated buffers.
541642
public void destroy() {
        if (sslEngine == null) {
            return;
        }

        // Close inbound and flush all remaining data if available.
        try {
            sslEngine.closeInbound();
        } catch (SSLException e) {
            LOGGER.debug(
                    "Unexpected exception from SSLEngine.closeInbound().", e);
        }


        if (outNetBuffer != null) {
            outNetBuffer.capacity(sslEngine.getSession().getPacketBufferSize());
        } else {
            createOutNetBuffer(0);
        }
        try {
            do {
                outNetBuffer.clear();
            } while (sslEngine.wrap(emptyBuffer.buf(), outNetBuffer.buf()).bytesProduced() > 0);
        } catch (SSLException e) {
            // Ignore.
        } finally {
            destroyOutNetBuffer();
        }

        sslEngine.closeOutbound();
        sslEngine = null;

        preHandshakeEventQueue.clear();
    }
121030
public void remove() {
    for (int i = 0; i < buf.length; i++) {
      buf[i] = null;// force null for easier garbage
    }
    buf = null;
  }
890228
private void recycleBuffer(MemorySegment buffer) {
		synchronized (this.buffers) {
			if (this.isDestroyed) {
				this.globalBufferPool.returnBuffer(buffer);
				this.numRequestedBuffers--;
			} else {
				// if the number of designated buffers changed in the meantime, make sure
				// to return the buffer to the global buffer pool
				if (this.numRequestedBuffers > this.numDesignatedBuffers) {
					this.globalBufferPool.returnBuffer(buffer);
					this.numRequestedBuffers--;

				} else if (!this.listeners.isEmpty()) {
					Buffer availableBuffer = new Buffer(buffer, buffer.size(), this.recycler);
					try {
						this.listeners.poll().bufferAvailable(availableBuffer);
					} catch (Exception e) {
						this.buffers.add(buffer);
						this.buffers.notify();
					}

				} else {
					this.buffers.add(buffer);
					this.buffers.notify();
				}
			}
		}
	}
140016
def discard_last(self, indices):
        """"""
        for i in indices:
            self.buffer_expire[i] = self.buffer_expire[i][:-1]
            self.buffer[i] = self.buffer[i][:-1]
205569
def clear(self):
        """"""
        self._wlock.acquire()
        try:
            self._mapping.clear()
            self._queue.clear()
        finally:
            self._wlock.release()
1026466
public void destroyAllBufferPools() {
		synchronized (factoryLock) {
			// create a copy to avoid concurrent modification exceptions
			LocalBufferPool[] poolsCopy = allBufferPools.toArray(new LocalBufferPool[allBufferPools.size()]);

			for (LocalBufferPool pool : poolsCopy) {
				pool.lazyDestroy();
			}

			// some sanity checks
			if (allBufferPools.size() > 0 || numTotalRequiredBuffers > 0) {
				throw new IllegalStateException("NetworkBufferPool is not empty after destroying all LocalBufferPools");
			}
		}
	}
266052
private void releaseAllChannelResources() {
		for (int i = 0; i < this.inputGates.size(); i++) {
			this.inputGates.get(i).releaseAllChannelResources();
		}

		for (int i = 0; i < this.outputGates.size(); i++) {
			this.outputGates.get(i).releaseAllChannelResources();
		}
	}
666704
private void free(IoSession session) {
        IoBuffer buf = buffersMap.remove(session);
        if (buf != null) {
            buf.free();
        }
    }
238797
def reset_local_buffers(self):
        
        agent_ids = list(self.keys())
        for k in agent_ids:
            self[k].reset_agent()
914367
def close(self, ulBuffer):
        """"""

        fn = self.function_table.close
        result = fn(ulBuffer)
        return result
1343594
private void releaseSessions() throws TTException {
        if (mSessions == null) {
            return;
        }

        // Closing all transactions.
        try {
            for (IFilelistenerWriteTrx trx : mTrx.values()) {
                trx.close();
            }
        } catch (IllegalStateException ise) {
            ise.printStackTrace();
        }

        // Closing all storages aswell.
        for (ISession s : mSessions.values()) {
            s.close();
        }
    }
1253754
private void clearBuffers() {
        // simply null out the parse buffers list, then release all the created buffers
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        for (int i = 0; i <= this.parseIndex; i++) {
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "Removing reference to parse buffer: " + this.parseBuffers[i]);
            }
            this.parseBuffers[i] = null;
            this.parseBuffersStartPos[i] = HeaderStorage.NOTSET;
        }
        this.parseIndex = HeaderStorage.NOTSET;
        for (int i = 0; i <= this.createdIndex; i++) {
            if (bTrace && tc.isDebugEnabled()) {
                Tr.debug(tc, "Releasing marshall buffer: " + this.myCreatedBuffers[i]);
            }
            this.myCreatedBuffers[i].release();
            this.myCreatedBuffers[i] = null;
        }
        this.createdIndex = HeaderStorage.NOTSET;
    }
631196
private void removeBuffers() {
		IntBuffer buffer = BufferUtils.createIntBuffer(1);
		int queued = AL10.alGetSourcei(source, AL10.AL_BUFFERS_QUEUED);
		
		while (queued > 0)
		{
			AL10.alSourceUnqueueBuffers(source, buffer);
			queued--;
		}
	}
1244225
def deallocate(self, batch):
        """"""
        self._incomplete.remove(batch)
        self._free.deallocate(batch.buffer())
643652
protected void releasing(ByteBuffer buffer) {
        if (buffer != null && buffer.isDirect()) {
            DirectByteBufferHelper directByteBufferHelper = this.directByteBufferHelper.get();
            if (directByteBufferHelper != null) {
                directByteBufferHelper.releaseDirectByteBuffer(buffer);
            }
        }
    }
685953
def clear(self):
        """"""
        self.mutex.acquire()
        self.queue.clear()
        self.mutex.release()
250112
public final void freeBuffers()
    {
        /* 11-Apr-2005, TSa: Ok, we can release the buffer now, to be
         *   recycled by the next stream reader instantiated by this
         *   thread (if any).
         */
	if (mRecycleBuffer) {
	    byte[] buf = mByteBuffer;
	    if (buf != null) {
		mByteBuffer = null;
		if (mConfig != null) {
		    mConfig.freeFullBBuffer(buf);
		}
	    }
	}
    }