mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-17 00:38:14 +00:00
Force threads to finish on CloseWindow()
This commit is contained in:
@@ -463,6 +463,9 @@ void CloseWindow(void)
|
|||||||
// Wait for mouse and gamepad threads to finish before closing
|
// Wait for mouse and gamepad threads to finish before closing
|
||||||
// NOTE: Those threads should already have finished at this point
|
// NOTE: Those threads should already have finished at this point
|
||||||
// because they are controlled by windowShouldClose variable
|
// because they are controlled by windowShouldClose variable
|
||||||
|
|
||||||
|
windowShouldClose = true; // Added to force threads to exit when the close window is called
|
||||||
|
|
||||||
pthread_join(mouseThreadId, NULL);
|
pthread_join(mouseThreadId, NULL);
|
||||||
pthread_join(gamepadThreadId, NULL);
|
pthread_join(gamepadThreadId, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user