diff --git a/example_test.go b/example_test.go index 2919e51..d66e015 100644 --- a/example_test.go +++ b/example_test.go @@ -20,6 +20,8 @@ func Example_basic() { if err != nil { log.Fatalf("Can't init face recognizer: %v", err) } + // Free the resources when you're finished. + defer rec.Close() // Test image with 10 faces. testImagePristin := filepath.Join(dataDir, "pristin.jpg") diff --git a/face_test.go b/face_test.go index eff2e74..8abdaab 100644 --- a/face_test.go +++ b/face_test.go @@ -181,3 +181,7 @@ func TestIdols(t *testing.T) { }) } } + +func TestClose(t *testing.T) { + rec.Close() +}