Should get lock before testing for connected

This commit is contained in:
Isaac Connor 2022-02-20 10:32:40 -05:00
parent aaf391fc65
commit 484827bdeb
1 changed files with 1 additions and 1 deletions

View File

@ -107,8 +107,8 @@ bool zmDbConnect() {
}
void zmDbClose() {
std::lock_guard<std::mutex> lck(db_mutex);
if (zmDbConnected) {
std::lock_guard<std::mutex> lck(db_mutex);
mysql_close(&dbconn);
// mysql_init() call implicitly mysql_library_init() but
// mysql_close() does not call mysql_library_end()