Пример #1
0
// Frees any resources allocated by liblzma. It does not close the
// underlying reader.
func (r *Decompressor) Close() error {
	if r != nil {
		C.lzma_end(r.handle)
		C.free(unsafe.Pointer(r.handle))
		r.handle = nil
	}
	return nil
}
Пример #2
0
// Frees any resources allocated by liblzma. It does not close the
// underlying reader.
func (enc *Compressor) Close() error {
	if enc != nil {
		er := enc.Flush()
		C.lzma_end(&enc.handle)
		if er != nil {
			return er
		}
	}
	return nil
}
Пример #3
0
// Frees any resources allocated by liblzma. It does not close the
// underlying reader.
func (enc *Compressor) Close() error {
	if enc != nil {
		er := enc.Flush()
		C.lzma_end(enc.handle)
		C.free(unsafe.Pointer(enc.handle))
		enc.handle = nil
		if er != nil {
			return er
		}
	}
	return nil
}
Пример #4
0
// Frees any resources allocated by liblzma. It does not close the
// underlying reader.
func (r *Decompressor) Close() error {
	if r != nil {
		C.lzma_end(&r.handle)
	}
	return nil
}