diff --git a/src/sndfile.jl b/src/sndfile.jl index b231e68..21664a6 100644 --- a/src/sndfile.jl +++ b/src/sndfile.jl @@ -84,8 +84,11 @@ end function open(f::Function, args...) file = AudioIO.open(args...) - f(file) - close(file) + try + f(file) + finally + close(file) + end end function af_open(args...)