summaryrefslogtreecommitdiff
path: root/libs/ardour/audiosource.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2014-12-13 12:46:24 +0000
committerJohn Emmas <johne53@tiscali.co.uk>2014-12-13 12:46:24 +0000
commit90010d098f438fd889bfd2d8a6b4e7e822e35008 (patch)
tree1ce11092d3d1602a6843b58795f56c7e6ca61d4e /libs/ardour/audiosource.cc
parentee38c44109bff63828dac220107f4b54c4a809a3 (diff)
Only attempt to close '_peakfile_fd' if we have a valid handle
Diffstat (limited to 'libs/ardour/audiosource.cc')
-rw-r--r--libs/ardour/audiosource.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index a032aa1f63..cc91ee9ba2 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -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;
}