mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-24 08:12:38 +02:00
Fix build on go < 1.7
This commit is contained in:
parent
5d4e3c7f9f
commit
c85534110f
9
keepalive.go
Normal file
9
keepalive.go
Normal file
@ -0,0 +1,9 @@
|
||||
// +build go1.7
|
||||
|
||||
package main
|
||||
|
||||
import "runtime"
|
||||
|
||||
func keepAlive(i interface{}) {
|
||||
runtime.KeepAlive(i)
|
||||
}
|
7
keepalive_old.go
Normal file
7
keepalive_old.go
Normal file
@ -0,0 +1,7 @@
|
||||
// +build !go1.7
|
||||
|
||||
package main
|
||||
|
||||
func keepAlive(i interface{}) {
|
||||
// Dummy function. Do nothing
|
||||
}
|
@ -160,7 +160,7 @@ func calcCrop(width, height int, po processingOptions) (left, top int) {
|
||||
}
|
||||
|
||||
func processImage(data []byte, imgtype imageType, po processingOptions) ([]byte, error) {
|
||||
defer runtime.KeepAlive(data)
|
||||
defer keepAlive(data)
|
||||
|
||||
err := C.int(0)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user