From 767263c9dd7b993308e8bb63d4bb5a2712ac9ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 14 Jun 2016 23:33:16 +0000 Subject: [PATCH] Fixed MySQL_Monitor_State_Data destructor --- lib/MySQL_Monitor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); }