MCPcopy Index your code
hub / github.com/klauspost/compress / Close

Method Close

zstd/decoder.go:581–603  ·  view source on GitHub ↗

Close will release all resources. It is NOT possible to reuse the decoder after this.

()

Source from the content-addressed store, hash-verified

579// Close will release all resources.
580// It is NOT possible to reuse the decoder after this.
581func (d *Decoder) Close() {
582 if d.current.err == ErrDecoderClosed {
583 return
584 }
585 d.drainOutput()
586 if d.current.cancel != nil {
587 d.current.cancel()
588 d.streamWg.Wait()
589 d.current.cancel = nil
590 }
591 if d.decoders != nil {
592 close(d.decoders)
593 for dec := range d.decoders {
594 dec.Close()
595 }
596 d.decoders = nil
597 }
598 if d.current.d != nil {
599 d.current.d.Close()
600 d.current.d = nil
601 }
602 d.current.err = ErrDecoderClosed
603}
604
605// IOReadCloser returns the decoder as an io.ReadCloser for convenience.
606// Any changes to the decoder will be reflected, so the returned ReadCloser

Callers 1

FuzzEncodingFunction · 0.95

Calls 2

drainOutputMethod · 0.95
CloseMethod · 0.65

Tested by 1

FuzzEncodingFunction · 0.76