mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 10:39:54 +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
|
// prepare the windows environment
|
||||||
CoInitialize(NULL);
|
CoInitialize(NULL);
|
||||||
|
|
||||||
|
std::unique_lock<std::mutex> lock(_deviceMutex, std::defer_lock);
|
||||||
|
|
||||||
// if disabled, clean up active clients
|
// if disabled, clean up active clients
|
||||||
if (!_enablePeakValues) {
|
if (!_enablePeakValues) {
|
||||||
activeClients.clear();
|
if (lock.try_lock()) {
|
||||||
|
// deferred, if timer callbacks overlap
|
||||||
|
activeClients.clear();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// lock the devices so the _inputDevices list is static
|
// lock the devices so the _inputDevices list is static
|
||||||
std::unique_lock<std::mutex> lock(_deviceMutex);
|
lock.lock();
|
||||||
HRESULT result;
|
HRESULT result;
|
||||||
|
|
||||||
// initialize the payload
|
// initialize the payload
|
||||||
|
|
Loading…
Reference in a new issue