Fix a deadlock that would occur when loading Twitch badges (#2756)

This commit is contained in:
pajlada 2021-05-08 15:29:12 +02:00 committed by GitHub
parent bb73069817
commit 6f6ccb8c2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -5,6 +5,7 @@
- Minor: Messages held by automod are now shown to the user. (#2626) - Minor: Messages held by automod are now shown to the user. (#2626)
- Bugfix: Automod messages now work properly again. (#2682) - Bugfix: Automod messages now work properly again. (#2682)
- Bugfix: `Login expired` message no longer highlights all tabs. (#2735) - Bugfix: `Login expired` message no longer highlights all tabs. (#2735)
- Bugfix: Fix a deadlock that would occur during user badge loading. (#1704, #2756)
## 2.3.1 ## 2.3.1

View file

@ -88,6 +88,10 @@ void TwitchBadges::loaded()
// Flush callback queue // Flush callback queue
std::unique_lock queueLock(this->queueMutex_); std::unique_lock queueLock(this->queueMutex_);
// Once we have gained unique access of the queue, we can release our unique access of the loaded mutex allowing future calls to read locked_
loadedLock.unlock();
while (!this->callbackQueue_.empty()) while (!this->callbackQueue_.empty())
{ {
auto callback = this->callbackQueue_.front(); auto callback = this->callbackQueue_.front();