UI: Lock input while mutating views/screens.

This way we can't get an axis event while switching screens and crash.
This commit is contained in:
Unknown W. Brackets
2016-09-11 11:26:35 -07:00
parent f77ba7ba3a
commit a52fbfcff7
5 changed files with 14 additions and 9 deletions
-6
View File
@@ -439,8 +439,6 @@ bool AnalogTestScreen::key(const KeyInput &key) {
return true;
}
lock_guard guard(eventLock_);
char buf[512];
snprintf(buf, sizeof(buf), "Keycode: %d Device ID: %d [%s%s%s%s]", key.keyCode, key.deviceId,
(key.flags & KEY_IS_REPEAT) ? "REP" : "",
@@ -461,8 +459,6 @@ bool AnalogTestScreen::axis(const AxisInput &axis) {
// a controller would be confusing for the user.
char buf[512];
lock_guard guard(eventLock_);
if (IgnoreAxisForMapping(axis.axisId))
return false;
@@ -482,8 +478,6 @@ bool AnalogTestScreen::axis(const AxisInput &axis) {
void AnalogTestScreen::CreateViews() {
using namespace UI;
lock_guard guard(eventLock_);
I18NCategory *di = GetI18NCategory("Dialog");
root_ = new LinearLayout(ORIENT_VERTICAL);