Removed unused cgo.NewHandle
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2022-11-09 21:54:43 +01:00
parent e92f79a950
commit 029e2fe619
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -8,7 +8,7 @@ import "C"
import (
"fmt"
"log"
"runtime/cgo"
"runtime"
"unsafe"
)
@ -142,9 +142,6 @@ func (g *Gaborator) GetBandwidth() float64 {
}
func (g *Gaborator) analyze(block []float32) {
handle := cgo.NewHandle(g.coefficientOutputChannel)
defer handle.Delete()
var returnSize C.size_t
var sliceSize C.size_t
var returnData *C.float
@ -152,6 +149,7 @@ func (g *Gaborator) analyze(block []float32) {
if len(block) == 0 {
returnData = C.gaborator_transform(g.pointer, (*C.float)(nil), C.int64_t(0), &returnSize, &sliceSize)
} else {
defer runtime.KeepAlive(block)
returnData = C.gaborator_transform(g.pointer, (*C.float)(&block[0]), C.int64_t(len(block)), &returnSize, &sliceSize)
}