// Close closes any open audio stream and terminates the PortAudio API.
198965
func (s *portAudioStream) Close() error {
	if err := s.reset(); err != nil {
		portaudio.Terminate()
		return err
	}
	return portaudio.Terminate()
}
909180
func (oc *OutputChannel) Close() {
	if oc.stop == nil {
		return
	}
	oc.stop <- struct{}{}
	<-oc.stop
	oc.stop = nil
	oc.Flush()
}
229048
func (c *compressionResponseWriter) Close() error {
	if c.compressorClosed() {
		return errors.New("Compressing error: tried to close already closed compressor")
	}

	c.compressor.Close()
	c.compressor = nil
	return nil
}
83577
func (c *IO) Close(handle string) (*gcdmessage.ChromeResponse, error) {
	var v IOCloseParams
	v.Handle = handle
	return c.CloseWithParams(&v)
}
255360
func (c *ContainerIO) Close() error {
	c.closer.Close()
	if c.fifos != nil {
		return c.fifos.Close()
	}
	return nil
}
40364
func (w *BatchedFileWriter) Close() error {
	// flush upload buffer
	err := w.uploadPartInput()

	w.completeMultipartUpload()

	return err
}
827810
func (l *preconnectedListener) Close() error {
	l.closeMu.Lock()
	defer l.closeMu.Unlock()
	if l.closech == nil {
		return nil
	}
	close(l.closech)
	l.closech = nil
	return nil
}
1095027
func (c *RPCClient) Close() error {
	close(c.streamTimeout)
	if raw, ok := c.MvccStore.(io.Closer); ok {
		return raw.Close()
	}
	return nil
}
579057
func (r *StreamRegistry) Close(s *Stream) error {
	s.Local.Close()
	s.Remote.Close()
	s.Registry.Deregister(s.id)
	return nil
}
769557
func (uvm *UtilityVM) Close() (err error) {
	op := "uvm::Close"
	log := logrus.WithFields(logrus.Fields{
		logfields.UVMID: uvm.id,
	})
	log.Debug(op + " - Begin Operation")
	defer func() {
		if err != nil {
			log.Data[logrus.ErrorKey] = err
			log.Error(op + " - End Operation - Error")
		} else {
			log.Debug(op + " - End Operation - Success")
		}
	}()

	uvm.hcsSystem.Terminate()
	uvm.Wait()

	// outputListener will only be nil for a Create -> Stop without a Start. In
	// this case we have no goroutine processing output so its safe to close the
	// channel here.
	if uvm.outputListener != nil {
		close(uvm.outputProcessingDone)
		uvm.outputListener.Close()
		uvm.outputListener = nil
	}
	return uvm.hcsSystem.Close()
}
1107889
func (r *Recorder) Close() error {
	r.bundler.Flush()
	return r.traceClient.Close()
}
380612
func (w *writeCloseInformer) Close() error {
	err := w.wc.Close()
	close(w.close)
	return err
}
165992
func (c *Client) Close() error {
	if err := c.Flush(); err != nil {
		return err
	}
	c.buf = nil
	return c.conn.Close()
}
249640
func (s *Stream) Close() error {
	if s.resampling != nil {
		return s.resampling.Close()
	}
	return nil
}
554861
func (p *Player) Close() error {
	runtime.SetFinalizer(p, nil)

	// Already closed
	if p.context == nil {
		return nil
	}

	// Close the pipe writer before RemoveSource, or Read-ing in the mux takes forever.
	if err := p.w.Close(); err != nil {
		return err
	}

	p.context.mux.RemoveSource(p.r)
	p.context = nil

	// Close the pipe reader after RemoveSource, or ErrClosedPipe happens at Read-ing.
	return p.r.Close()
}
311618
func (m *Memory) Close() error {
	m.cancel()
	m.Lock()
	defer m.Unlock()
	m.buf.Close()
	return nil
}
590044
func (l *Listener) Close() error {
	l.init()

	l.Lock()
	defer l.Unlock()

	// short-circuit with an error if we are already closed
	select {
	case <-l.closing:
		return &net.OpError{
			Op:   "close",
			Net:  network,
			Addr: l.Addr(),
			Err:  neterr{timeout: false, err: listenerClosed},
		}
	default:
		l.connc = nil
		close(l.closing)
	}

	return nil
}