func (m *magic) close() { if m != nil && m.cookie != nil { // This will free resources on the Magic library side. C.magic_close(m.cookie) m.path = []string{} m.cookie = nil } runtime.SetFinalizer(m, nil) }
// Close closes the database connection. func (m *Magic) Close() (err error) { if m.ptr == nil { return ConnectionError } C.magic_close(m.ptr) m.ptr = nil return }
func (detector *Detector) Close() error { _, err1 := C.ucsdet_close(detector.ucsd) _, err2 := C.magic_close(detector.magic) if err1 != nil { return err1 } return err2 }
func Close(cookie Magic_t) { C.magic_close((C.magic_t)(cookie)) }
func (m *Magic) Close() { C.magic_close(m.db) }
// Close frees up resources associated with d. func (d *Decoder) Close() { C.magic_close(d.db) d.db = nil }
func Close() { C.magic_close(db) db = nil }