Explorar o código

- Fixed cleanup for threading (valgrind complain)

Joey Ferwerda %!s(int64=9) %!d(string=hai) anos
pai
achega
0c6de95ac3
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/openhmd.c

+ 2 - 2
src/openhmd.c

@@ -44,6 +44,8 @@ ohmd_context* OHMD_APIENTRY ohmd_ctx_create(void)
 
 void OHMD_APIENTRY ohmd_ctx_destroy(ohmd_context* ctx)
 {
+	ctx->update_request_quit = true;
+
 	for(int i = 0; i < ctx->num_active_devices; i++){
 		ctx->active_devices[i]->close(ctx->active_devices[i]);
 	}
@@ -51,8 +53,6 @@ void OHMD_APIENTRY ohmd_ctx_destroy(ohmd_context* ctx)
 	for(int i = 0; i < ctx->num_drivers; i++){
 		ctx->drivers[i]->destroy(ctx->drivers[i]);
 	}
-		
-	ctx->update_request_quit = true;
 
 	if(ctx->update_thread){
 		ohmd_destroy_thread(ctx->update_thread);