From 7124a809e5aa299e7f45acb5599e00f1a49d39b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sat, 27 Feb 2016 22:03:48 +0000 Subject: [PATCH] delete MySQL_Thread on delete MySQL_Monitor To make valgrind happy --- lib/MySQL_Monitor.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index e6caab3bb..8569d59ed 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -815,6 +815,10 @@ __sleep_monitor_connect_loop: usleep(st); } } + if (mysql_thr) { + delete mysql_thr; + mysql_thr=NULL; + } return NULL; } @@ -951,6 +955,10 @@ __sleep_monitor_ping_loop: usleep(st); } } + if (mysql_thr) { + delete mysql_thr; + mysql_thr=NULL; + } return NULL; } @@ -1126,6 +1134,10 @@ __sleep_monitor_read_only: usleep(st); } } + if (mysql_thr) { + delete mysql_thr; + mysql_thr=NULL; + } return NULL; } @@ -1297,6 +1309,10 @@ __sleep_monitor_replication_lag: usleep(st); } } + if (mysql_thr) { + delete mysql_thr; + mysql_thr=NULL; + } return NULL; } @@ -1325,5 +1341,9 @@ void * MySQL_Monitor::run() { monitor_ping_thread->join(); monitor_read_only_thread->join(); monitor_replication_lag_thread->join(); + if (mysql_thr) { + delete mysql_thr; + mysql_thr=NULL; + } return NULL; };