Only attempt to close our peakfile '_fd' if we have a valid handle

(yesterday's fix was needed in a 2nd place)
This commit is contained in:
John Emmas 2014-12-14 10:39:29 +00:00
parent 90010d098f
commit 1b3fb142f0

View file

@ -322,7 +322,7 @@ AudioSource::read_peaks (PeakData *peaks, framecnt_t npeaks, framepos_t start, f
struct ScopedFileDescriptor {
ScopedFileDescriptor (int fd) : _fd (fd) {}
~ScopedFileDescriptor() { close (_fd); }
~ScopedFileDescriptor() { if ((-1) != _fd) close (_fd); }
operator int() { return _fd; }
int _fd;
};