Should get lock before testing for connected

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

View File

@ -108,8 +108,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()