Skip to content

Commit 6bb3479

Browse files
authored
Merge pull request #10 from hasantr/windows-compatibility-fix
Fix Windows compatibility: Add missing CleanUp method
2 parents ea10365 + 618ddc9 commit 6bb3479

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

imageflow_job_windows.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
//go:build windows
12
// +build windows
23

34
package imageflow
45

56
/*
67
#cgo LDFLAGS: -L./ -limageflow
78
#include "imageflow.h"
9+
#include <stdlib.h>
810
*/
911
import "C"
1012
import (
@@ -89,6 +91,11 @@ func (job *job) GetOutput(id uint) ([]byte, error) {
8991
return C.GoBytes((unsafe.Pointer)(ptr), C.int(l)), nil
9092
}
9193

94+
// Frees the context and C allocations.
95+
func (j *job) CleanUp() {
96+
C.imageflow_context_destroy(j.inner)
97+
}
98+
9299
// ReadError from context
93100
func (job *job) ReadError() error {
94101
l := 0

0 commit comments

Comments
 (0)