func createHandler(f func(h *C.handler) C.int) (*C.handler, error) { h := C.newHandler() if err := result(f(h)); err != nil { C.handlerFree(h) return nil, err } return h, nil }
func (p *Phidget) unsetOnEventHandler(t eventType, h **C.handler) { C.unsetOnEventHandler(p.handle, C.eventType(t)) C.handlerFree(*h) *h = nil }
func (p *Phidget) unsetOnErrorHandler() { C.unsetOnErrorHandler(p.handle) C.handlerFree(p.onErrorHandler) p.onErrorHandler = nil }
func (i *InterfaceKit) unsetOnChangeHandler(t onChangeType, h **C.handler) { C.unsetOnChangeHandler(i.ifkHandle, C.onChangeType(t)) C.handlerFree(*h) *h = nil }
func (i *IR) unsetOnRawDataHandler() { C.unsetOnCodeHandler(i.handle) C.handlerFree(i.onRawDataHandler) i.onRawDataHandler = nil }
func (i *IR) unsetOnLearnHandler() { C.unsetOnCodeHandler(i.handle) C.handlerFree(i.onLearnHandler) i.onLearnHandler = nil }