Fix occasional crash on exit under Wayland

pthread_cancel was sometimes called once the thread had exited,
resolve this by having the function wait to be canceled.
This commit is contained in:
Campbell Barton 2023-05-19 19:51:42 +10:00
parent 8a4ab1b3fe
commit c007e6a346

@ -5470,6 +5470,13 @@ static void *gwl_display_event_thread_fn(void *display_voidp)
break;
}
}
/* Wait until the main thread cancels this thread, otherwise this thread may exit
* before cancel is called, causing a crash on exit. */
while (true) {
pause();
}
return nullptr;
}