valgrind memory leak errors when using pthread_create
A thread’s resources are not immediately released at termination, unless the thread was created with the detach state attribute set to PTHREAD_CREATE_DETACHED, or if pthread_detach is called for its pthread_t. An undetached thread will remain terminated state until its identifier is passed to pthread_join or pthread_detach. To sum it up, you have three options: create … Read more