From 1142d4edae645f9e5b235c2c3278a8d16a1f97cf Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 24 Oct 2016 19:08:23 +0200 Subject: [PATCH] Force threads to finish on CloseWindow() --- src/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core.c b/src/core.c index b8a8ac05..dd005836 100644 --- a/src/core.c +++ b/src/core.c @@ -463,6 +463,9 @@ void CloseWindow(void) // Wait for mouse and gamepad threads to finish before closing // NOTE: Those threads should already have finished at this point // 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(gamepadThreadId, NULL); #endif