Removed unused cgo.NewHandle
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e92f79a950
commit
029e2fe619
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue