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...)
|
||||
file = AudioIO.open(args...)
|
||||
f(file)
|
||||
close(file)
|
||||
try
|
||||
f(file)
|
||||
finally
|
||||
close(file)
|
||||
end
|
||||
end
|
||||
|
||||
function af_open(args...)
|
||||
|
|
Loading…
Reference in a new issue