Skip to content

Commit

Permalink
Prevent a deadlock between View::eventMutex_ and ScreenManager::input…
Browse files Browse the repository at this point in the history
…Mutex_ by locking here so the reverse lock order can't happen.
  • Loading branch information
hrydgard committed May 18, 2017
1 parent d061351 commit 2f5ea23
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/native/ui/screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ void ScreenManager::switchScreen(Screen *screen) {
}

void ScreenManager::update() {
std::lock_guard<std::recursive_mutex> guard(inputLock_);
if (nextScreen_) {
switchToNext();
}
Expand Down

0 comments on commit 2f5ea23

Please sign in to comment.