From dd28b530eaf2b3e75221eb0052da32937ed5a606 Mon Sep 17 00:00:00 2001 From: Spencer Russell Date: Thu, 21 Aug 2014 01:05:03 -0400 Subject: [PATCH] adds try-finally to open so it's actually safe --- src/sndfile.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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...)