Only attempt to close '_peakfile_fd' if we have a valid handle

This commit is contained in:
John Emmas
2014-12-13 12:46:24 +00:00
parent ee38c44109
commit 90010d098f

View 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;
}