From ac2c62e560ad1b3c5d93fbc2aa5a554fc57e1b9e Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 4 Jan 2022 10:38:15 +1100 Subject: [PATCH] [host] intiialize the app state earlier to prevent ovewriting re-inits If there is LGMP corruption the LGMP thread will set the state to REINIT which if this happens early enough will get overwritten if the inital app state is set too late. Instead set the application initial state early to avoid this. --- host/src/app.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/host/src/app.c b/host/src/app.c index 47061a69..869abb48 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -603,6 +603,7 @@ int app_main(int argc, char * argv[]) if (!installCrashHandler(os_getExecutable())) DEBUG_WARN("Failed to install the crash handler"); + app.state = APP_STATE_RUNNING; ivshmemOptionsInit(); // register capture interface options @@ -721,7 +722,6 @@ int app_main(int argc, char * argv[]) DEBUG_INFO("Capture Method : %s", iface->asyncCapture ? "Asynchronous" : "Synchronous"); - app.state = APP_STATE_RUNNING; app.iface = iface; LG_LOCK_INIT(app.pointerLock);