adds try-finally to open so it's actually safe
This commit is contained in:
parent
2620e6ecb2
commit
dd28b530ea
1 changed files with 5 additions and 2 deletions
|
@ -84,8 +84,11 @@ end
|
||||||
|
|
||||||
function open(f::Function, args...)
|
function open(f::Function, args...)
|
||||||
file = AudioIO.open(args...)
|
file = AudioIO.open(args...)
|
||||||
|
try
|
||||||
f(file)
|
f(file)
|
||||||
|
finally
|
||||||
close(file)
|
close(file)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function af_open(args...)
|
function af_open(args...)
|
||||||
|
|
Loading…
Reference in a new issue