Example #1
0
// 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)
	}
}
Example #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
}