mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #8972 from sethalves/fix-for-2159
lock around audio-client quit flag to avoid shutdown race
This commit is contained in:
commit
56b3ac8c89
1 changed files with 10 additions and 2 deletions
|
@ -85,18 +85,26 @@ public:
|
|||
}
|
||||
|
||||
void beforeAboutToQuit() {
|
||||
Lock lock(_checkDevicesMutex);
|
||||
_quit = true;
|
||||
}
|
||||
|
||||
void run() override {
|
||||
while (!_quit) {
|
||||
while (true) {
|
||||
{
|
||||
Lock lock(_checkDevicesMutex);
|
||||
if (_quit) {
|
||||
break;
|
||||
}
|
||||
_audioClient->checkDevices();
|
||||
}
|
||||
QThread::msleep(DEVICE_CHECK_INTERVAL_MSECS);
|
||||
_audioClient->checkDevices();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
AudioClient* _audioClient { nullptr };
|
||||
Mutex _checkDevicesMutex;
|
||||
bool _quit { false };
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue