diff --git a/tests/test_sorcery_memory_cache_thrash.c b/tests/test_sorcery_memory_cache_thrash.c index daf5234710..d911e869ef 100644 --- a/tests/test_sorcery_memory_cache_thrash.c +++ b/tests/test_sorcery_memory_cache_thrash.c @@ -304,6 +304,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);