// 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) } }
func (detector *Detector) Close() error { _, err1 := C.ucsdet_close(detector.ucsd) _, err2 := C.magic_close(detector.magic) if err1 != nil { return err1 } return err2 }