diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 45ba6b38c..89dfc089b 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -280,7 +280,11 @@ class MySQL_Monitor_State_Data { if (hostname) { free(hostname); } - assert(mysql==NULL); // if mysql is not NULL, there is a bug + //assert(mysql==NULL); // if mysql is not NULL, there is a bug + if (mysql) { + close_mysql(mysql); + mysql=NULL; + } if (mysql_error_msg) { free(mysql_error_msg); }