Only attempt to close our peakfile '_fd' if we have a valid handle
authorJohn Emmas <johne53@tiscali.co.uk>
Sun, 14 Dec 2014 10:39:29 +0000 (10:39 +0000)
committerJohn Emmas <johne53@tiscali.co.uk>
Sun, 14 Dec 2014 10:39:29 +0000 (10:39 +0000)
(yesterday's fix was needed in a 2nd place)

libs/ardour/audiosource.cc

index cc91ee9ba205076ea106c75f2f082e9c2bc4cdc3..f543c3ee082fb7d1d21653923a6e889e68dbfb81 100644 (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;
 };