mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 01:58:25 +00:00
[client] fix shutdown race condition with the frame thread
This commit is contained in:
parent
da94075e7b
commit
e93bd7a3bf
@ -155,8 +155,13 @@ static int renderThread(void * unused)
|
|||||||
}
|
}
|
||||||
|
|
||||||
state.running = false;
|
state.running = false;
|
||||||
|
|
||||||
|
if (t_cursor)
|
||||||
SDL_WaitThread(t_cursor, NULL);
|
SDL_WaitThread(t_cursor, NULL);
|
||||||
|
|
||||||
|
if (state.t_frame)
|
||||||
|
SDL_WaitThread(state.t_frame, NULL);
|
||||||
|
|
||||||
state.lgr->deinitialize(state.lgrData);
|
state.lgr->deinitialize(state.lgrData);
|
||||||
state.lgr = NULL;
|
state.lgr = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
@ -1204,7 +1209,6 @@ int run()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDL_Thread *t_spice = NULL;
|
SDL_Thread *t_spice = NULL;
|
||||||
SDL_Thread *t_frame = NULL;
|
|
||||||
SDL_Thread *t_render = NULL;
|
SDL_Thread *t_render = NULL;
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
@ -1284,7 +1288,7 @@ int run()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(t_frame = SDL_CreateThread(frameThread, "frameThread", NULL)))
|
if (!(state.t_frame = SDL_CreateThread(frameThread, "frameThread", NULL)))
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("frame create thread failed");
|
DEBUG_ERROR("frame create thread failed");
|
||||||
break;
|
break;
|
||||||
@ -1326,9 +1330,6 @@ int run()
|
|||||||
if (t_render)
|
if (t_render)
|
||||||
SDL_WaitThread(t_render, NULL);
|
SDL_WaitThread(t_render, NULL);
|
||||||
|
|
||||||
if (t_frame)
|
|
||||||
SDL_WaitThread(t_frame, NULL);
|
|
||||||
|
|
||||||
// if spice is still connected send key up events for any pressed keys
|
// if spice is still connected send key up events for any pressed keys
|
||||||
if (params.useSpiceInput && spice_ready())
|
if (params.useSpiceInput && spice_ready())
|
||||||
{
|
{
|
||||||
|
@ -49,6 +49,8 @@ struct AppState
|
|||||||
void * lgrData;
|
void * lgrData;
|
||||||
bool lgrResize;
|
bool lgrResize;
|
||||||
|
|
||||||
|
SDL_Thread * t_frame;
|
||||||
|
|
||||||
const LG_Clipboard * lgc;
|
const LG_Clipboard * lgc;
|
||||||
SpiceDataType cbType;
|
SpiceDataType cbType;
|
||||||
struct ll * cbRequestList;
|
struct ll * cbRequestList;
|
||||||
|
Loading…
Reference in New Issue
Block a user