[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.
This commit is contained in:
Geoffrey McRae 2021-01-25 15:25:52 +11:00
parent 3783a25211
commit 837858c214

View File

@ -2046,6 +2046,8 @@ static int lg_run(void)
return -1; return -1;
} }
lgInit();
// start the renderThread so we don't just display junk // start the renderThread so we don't just display junk
if (!lgCreateThread("renderThread", renderThread, NULL, &t_render)) if (!lgCreateThread("renderThread", renderThread, NULL, &t_render))
{ {
@ -2088,8 +2090,6 @@ static int lg_run(void)
KVMFR *udata; KVMFR *udata;
int waitCount = 0; int waitCount = 0;
lgInit();
restart: restart:
while(g_state.state == APP_STATE_RUNNING) while(g_state.state == APP_STATE_RUNNING)
{ {