Commit fed7252c authored by Carla Guillen's avatar Carla Guillen
Browse files

In case sql connection is gone (error 2006), we finalize the connection to...

In case sql connection is gone (error 2006), we finalize the connection to avoid memory leaks in mariadb lib.
parent ea761e77
......@@ -70,7 +70,8 @@ std::mutex PerSystDB::mut;
void PerSystDB::print_error(){
LOG(error) << "Error(" << mysql_errno(_mysql) << ") [" << mysql_sqlstate(_mysql) << "] \""<< mysql_error(_mysql) << "\"" ;
if(mysql_errno(_mysql) == 2006){
_initialized = false;
mysql_close(_mysql);
_initialized=false;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment