From b3de6f7ae687978a2001988028b15d251ed9614b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 28 Dec 2017 00:01:51 +0100 Subject: [PATCH] Stop HGCU_thread_run as the first task of MySQL_HostGroups_Manager destructor #1299 --- lib/MySQL_HostGroups_Manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 34430c48d..84ce70b65 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -382,6 +382,8 @@ MySQL_HostGroups_Manager::MySQL_HostGroups_Manager() { } MySQL_HostGroups_Manager::~MySQL_HostGroups_Manager() { + queue.add(NULL); + HGCU_thread->join(); while (MyHostGroups->len) { MyHGC *myhgc=(MyHGC *)MyHostGroups->remove_index_fast(0); delete myhgc; @@ -391,8 +393,6 @@ MySQL_HostGroups_Manager::~MySQL_HostGroups_Manager() { if (admindb) { delete admindb; } - queue.add(NULL); - HGCU_thread->join(); #ifdef MHM_PTHREAD_MUTEX pthread_mutex_destroy(&lock); #endif