core_loading_thread example join thread on completion (#2845)

* core_loading_thread example join thread on completion

* error checking
This commit is contained in:
Antonis Geralis 2022-12-31 20:25:35 +02:00 committed by GitHub
parent dbdbbea471
commit ba38fe5b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,10 @@ int main(void)
if (atomic_load(&dataLoaded))
{
framesCounter = 0;
int error = pthread_join(threadId, NULL);
if (error != 0) TraceLog(LOG_ERROR, "Error joining loading thread");
else TraceLog(LOG_INFO, "Loading thread terminated successfully");
state = STATE_FINISHED;
}
} break;