From 90010d098f438fd889bfd2d8a6b4e7e822e35008 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Sat, 13 Dec 2014 12:46:24 +0000 Subject: Only attempt to close '_peakfile_fd' if we have a valid handle --- libs/ardour/audiosource.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libs') 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; } -- cgit v1.2.3