Only attempt to close '_peakfile_fd' if we have a valid handle
authorJohn Emmas <johne53@tiscali.co.uk>
Sat, 13 Dec 2014 12:46:24 +0000 (12:46 +0000)
committerJohn Emmas <johne53@tiscali.co.uk>
Sat, 13 Dec 2014 12:46:24 +0000 (12:46 +0000)
libs/ardour/audiosource.cc

index a032aa1f6379df7dd308eaa8aed4623280f35912..cc91ee9ba205076ea106c75f2f082e9c2bc4cdc3 100644 (file)
@@ -103,8 +103,10 @@ AudioSource::~AudioSource ()
                cerr << "AudioSource destroyed with leftover peak data pending" << endl;
        }
 
-       close (_peakfile_fd);
-       _peakfile_fd = -1;
+       if ((-1) != _peakfile_fd) {
+               close (_peakfile_fd);
+               _peakfile_fd = -1;
+       }
 
        delete [] peak_leftovers;
 }