// Close() - release the buffer address for garbage collection
436712
func (buf *XmlBuffer)Close() {
	mtx.Lock()
	defer mtx.Unlock()
	delete(activeXmlBufs,buf.cnt)
}
1016082
func (g *Generator) Close() error {
	C.avcodec_close(g.avcContext)
	C.avformat_close_input(&g.avfContext)
	return nil
}
320769
func (elf *ELF) Close() (err error) {
	if elf.file != nil {
		err = elf.file.Close()
	}
	return err
}
1373626
func (batch *Batch) Close() error {
	batch.mutex.Lock()
	err := batch.close()
	batch.mutex.Unlock()
	return err
}
537641
func (session *Session) Close() {
	for _, v := range session.stmtCache {
		v.Close()
	}

	if session.db != nil {
		// When Close be called, if session is a transaction and do not call
		// Commit or Rollback, then call Rollback.
		if session.Tx != nil && !session.IsCommitedOrRollbacked {
			session.Rollback()
		}
		session.Tx = nil
		session.stmtCache = nil
		session.db = nil

		session.Statement.Init()
		session.IsAutoCommit = true
		session.IsCommitedOrRollbacked = false
		session.IsAutoClose = false
		session.AutoResetStatement = true
		session.prepareStmt = false

		// processors
		session.afterInsertBeans = nil
		session.afterUpdateBeans = nil
		session.afterDeleteBeans = nil
		session.beforeClosures = nil
		session.afterClosures = nil
	}
}
190319
func (c *Conn) Close() error {
	c.pipe.once.Do(func() {

		// Buffered connections will attempt to wait until all
		// pending Writes are completed or until the specified
		// timeout value has elapsed.
		if c.laddr.Buffered() {

			// Set up a channel that is closed when the specified
			// timer elapses.
			timeout := c.CloseTimeout()
			timeoutDone := make(chan struct{})
			if timeout == 0 {
				close(timeoutDone)
			} else {
				time.AfterFunc(timeout, func() { close(timeoutDone) })
			}

			// Set up a channel that is closed when there is
			// no more buffered data.
			writesDone := make(chan struct{})
			go func() {
				c.buf.dataMu.Lock()
				defer c.buf.dataMu.Unlock()
				for len(c.buf.dataN) > 0 {
					c.buf.dataMu.Unlock()
					c.buf.dataMu.Lock()
				}
				close(writesDone)
			}()

			// Wait to close the connection.
			select {
			case <-writesDone:
			case <-timeoutDone:
			}
		}

		close(c.pipe.localDone)
	})
	return nil
}
918122
func (c *GRPCConnection) Close() {
	if !c.setClosed() {
		logger.Debug("Already closed")
		return
	}

	logger.Debug("Releasing connection....")
	c.commManager.ReleaseConn(c.conn)

	logger.Debug("... connection successfully closed.")
}
856282
func (s *spiDriver) Close() error {
	for _, b := range s.busMap {
		b.Close()
	}

	return nil
}
694778
func (s *WriterSender) Close() error {
	s.mu.Lock()
	defer s.mu.Unlock()

	if err := s.writer.Flush(); err != nil {
		return err
	}

	s.Send(message.NewBytesMessage(s.priority, bytes.TrimRightFunc(s.buffer.Bytes(), unicode.IsSpace)))
	s.buffer.Reset()
	s.writer.Reset(s.buffer)
	return nil
}
869074
func (ev *msgEventer) Close() error {
	if v, ok := ev.MsgReadWriter.(io.Closer); ok {
		return v.Close()
	}
	return nil
}
250773
func (loop Loop) Close() error {
	errc := make(chan error)
	loop.closing <- errc
	return <-errc
}
1112071
func (c *SocketConnection) Close() error {
	if err := c.Conn.Close(); err != nil {
		return err
	}

	return nil
}
242195
func (store *MemoryStore) Close() {
	store.Lock()
	defer store.Unlock()
	chkcond(store.opened)
	store.opened = false
	DEBUG.Println(STR, "memorystore closed")
}
83577
func (c *IO) Close(handle string) (*gcdmessage.ChromeResponse, error) {
	var v IOCloseParams
	v.Handle = handle
	return c.CloseWithParams(&v)
}
656774
func (h *Heap) Close() {
	h.lock.Lock()
	defer h.lock.Unlock()
	h.closed = true
	h.cond.Broadcast()
}
1023563
func (s *serialWriteCloser) Close() error {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.wc.Close()
}
27959
func (s *Stream) Close() error {
	if s.pmStream == nil {
		return nil
	}
	return convertToError(C.Pm_Close(unsafe.Pointer(s.pmStream)))
}