decrement thead_count *after* THD is destroyed

because thread_count means just that: number of THDs
and shutdown code looks at it to know when to free
shared data structures that THD uses.

This fixes random crashes in ~THD on shutdown
This commit is contained in:
Sergei Golubchik 2016-05-09 18:30:22 +02:00
commit 7425610c81
3 changed files with 4 additions and 2 deletions

View file

@ -39,6 +39,7 @@ static bool no_threads_end(THD *thd, bool put_in_cache)
{
unlink_thd(thd);
delete thd;
dec_thread_count();
}
return 1; // Abort handle_one_connection
}