close audio-file if it cannot be opened
This commit is contained in:
parent
0761902b7e
commit
676a23e031
@ -96,6 +96,10 @@ SndFileDescriptor::open ()
|
|||||||
|
|
||||||
_sndfile = sf_open_fd (fd, _writeable ? SFM_RDWR : SFM_READ, _info, 1);
|
_sndfile = sf_open_fd (fd, _writeable ? SFM_RDWR : SFM_READ, _info, 1);
|
||||||
|
|
||||||
|
if (sf_open_fd == 0) {
|
||||||
|
::close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
return (_sndfile == 0);
|
return (_sndfile == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user