mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 08:13:08 +00:00
Fix last leak detected by Valgrind
This was subtle and google was my friend. The leak was in _dl_allocate_tls called by pthread_create() and is due to the fact that threads are created in joinable state so that once terminated are not freed. To make the thread to release its resources upon termination we should set them in detached state. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
5254ca22f3
commit
f790752daa
1 changed files with 1 additions and 0 deletions
|
@ -2336,6 +2336,7 @@ split_point_start: // At split points actual search starts from here
|
|||
#if !defined(_MSC_VER)
|
||||
pthread_t pthread[1];
|
||||
ok = (pthread_create(pthread, NULL, init_thread, (void*)(&i)) == 0);
|
||||
pthread_detach(pthread[0]);
|
||||
#else
|
||||
ok = (CreateThread(NULL, 0, init_thread, (LPVOID)(&i), 0, NULL) != NULL);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue