[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.
This commit is contained in:
Geoffrey McRae 2022-01-04 10:38:15 +11:00
parent 4b8255aa28
commit ac2c62e560

View File

@ -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);