lock SignalVector with shared_lock to allow reading on other threads

This commit is contained in:
fourtf
2019-07-31 22:29:07 +02:00
parent 4e4c7d4c0b
commit fff979b3c0
12 changed files with 120 additions and 35 deletions
@@ -35,7 +35,7 @@ std::vector<QString> TwitchAccountManager::getUsernames() const
std::lock_guard<std::mutex> lock(this->mutex_);
for (const auto &user : this->accounts.getVector())
for (const auto &user : this->accounts)
{
userNames.push_back(user->getUserName());
}
@@ -48,7 +48,7 @@ std::shared_ptr<TwitchAccount> TwitchAccountManager::findUserByUsername(
{
std::lock_guard<std::mutex> lock(this->mutex_);
for (const auto &user : this->accounts.getVector())
for (const auto &user : this->accounts)
{
if (username.compare(user->getUserName(), Qt::CaseInsensitive) == 0)
{