From 837858c214eb7ebdb4e88579739a0ba499320853 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 25 Jan 2021 15:25:52 +1100 Subject: [PATCH] [client] prevent `lgInit` from resetting the run state If the renderer fails to start it sets the run state to stopped, having lgInit where it was causes this to be reset to running triggering invalid usage of g_state.lgmp. --- client/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index 8a419178..e90709e4 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -2046,6 +2046,8 @@ static int lg_run(void) return -1; } + lgInit(); + // start the renderThread so we don't just display junk if (!lgCreateThread("renderThread", renderThread, NULL, &t_render)) { @@ -2088,8 +2090,6 @@ static int lg_run(void) KVMFR *udata; int waitCount = 0; - lgInit(); - restart: while(g_state.state == APP_STATE_RUNNING) {