Skip to content

Commit

Permalink
fix: protect print of specifying next color with lock
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusabary committed Dec 8, 2020
1 parent ab192b8 commit f2fc533
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/ui_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ std::pair<InputAction, int> UIManager::GetAction(bool lastCardCanBePlayed,
CardColor UIManager::SpecifyNextColor()
{
mIsSpecifyingNextColor = true;
Print();
{
std::lock_guard<std::mutex> lock(mMutex);
Print();
}

CardColor nextColor;
ExecuteWithTimePassing([this, &nextColor] {
Expand Down

0 comments on commit f2fc533

Please # to comment.