1
0
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:
DarthSim 2017-09-27 23:22:13 +06:00
parent 5d4e3c7f9f
commit c85534110f
3 changed files with 17 additions and 1 deletions

9
keepalive.go Normal file
View 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
View File

@ -0,0 +1,7 @@
// +build !go1.7
package main
func keepAlive(i interface{}) {
// Dummy function. Do nothing
}

View File

@ -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)