mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 17:22:40 +02:00
Merge pull request #12586 from kencooke/audio-peakmeters-fix
Fix crash when closing the Audio menu
This commit is contained in:
commit
bcf893db18
1 changed files with 7 additions and 2 deletions
|
@ -43,14 +43,19 @@ void AudioClient::checkPeakValues() {
|
|||
// prepare the windows environment
|
||||
CoInitialize(NULL);
|
||||
|
||||
std::unique_lock<std::mutex> lock(_deviceMutex, std::defer_lock);
|
||||
|
||||
// if disabled, clean up active clients
|
||||
if (!_enablePeakValues) {
|
||||
activeClients.clear();
|
||||
if (lock.try_lock()) {
|
||||
// deferred, if timer callbacks overlap
|
||||
activeClients.clear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// lock the devices so the _inputDevices list is static
|
||||
std::unique_lock<std::mutex> lock(_deviceMutex);
|
||||
lock.lock();
|
||||
HRESULT result;
|
||||
|
||||
// initialize the payload
|
||||
|
|
Loading…
Reference in a new issue