示例#1
0
文件: detect.go 项目: goodsign/icu
// Close frees native C resources
func (det *CharsetDetector) Close() {
	det.gMutex.Lock()
	defer det.gMutex.Unlock()

	if det.ptr != nil {
		C.ucsdet_close(det.ptr)
	}
}
示例#2
0
func (detector *Detector) Close() error {
	_, err1 := C.ucsdet_close(detector.ucsd)
	_, err2 := C.magic_close(detector.magic)

	if err1 != nil {
		return err1
	}
	return err2
}