diff --git a/tests/test_sorcery_memory_cache_thrash.c b/tests/test_sorcery_memory_cache_thrash.c index 2d18317a31..c0d25feb34 100644 --- a/tests/test_sorcery_memory_cache_thrash.c +++ b/tests/test_sorcery_memory_cache_thrash.c @@ -302,6 +302,15 @@ static void sorcery_memory_cache_thrash_stop(struct sorcery_memory_cache_thrash } thread->stop = 1; + } + + for (idx = 0; idx < AST_VECTOR_SIZE(&thrash->threads); ++idx) { + struct sorcery_memory_cache_thrash_thread *thread; + + thread = AST_VECTOR_GET(&thrash->threads, idx); + if (thread->thread == AST_PTHREADT_NULL) { + continue; + } pthread_join(thread->thread, NULL);