From db62f48f18a61818f88051f8358976ba2ed430f4 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 21 Jan 2016 11:20:32 +0100 Subject: Add missing mutex lock guards to AudioCacheFiles get and release methods. --- src/audiocachefile.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/audiocachefile.cc b/src/audiocachefile.cc index c1fdd7b..0a81ca4 100644 --- a/src/audiocachefile.cc +++ b/src/audiocachefile.cc @@ -123,6 +123,8 @@ void AudioCacheFile::readChunk(const CacheChannels& channels, AudioCacheFile& AudioCacheFiles::getFile(const std::string& filename) { + std::lock_guard lock(mutex); + AudioCacheFile* cacheAudioFile = nullptr; auto it = audiofiles.find(filename); @@ -146,6 +148,8 @@ AudioCacheFile& AudioCacheFiles::getFile(const std::string& filename) void AudioCacheFiles::releaseFile(const std::string& filename) { + std::lock_guard lock(mutex); + auto it = audiofiles.find(filename); if(it == audiofiles.end()) { -- cgit v1.2.3