Should get lock before testing for connected
This commit is contained in:
parent
fe69261f10
commit
b896974a29
|
@ -108,8 +108,8 @@ bool zmDbConnect() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void zmDbClose() {
|
void zmDbClose() {
|
||||||
|
std::lock_guard<std::mutex> lck(db_mutex);
|
||||||
if (zmDbConnected) {
|
if (zmDbConnected) {
|
||||||
std::lock_guard<std::mutex> lck(db_mutex);
|
|
||||||
mysql_close(&dbconn);
|
mysql_close(&dbconn);
|
||||||
// mysql_init() call implicitly mysql_library_init() but
|
// mysql_init() call implicitly mysql_library_init() but
|
||||||
// mysql_close() does not call mysql_library_end()
|
// mysql_close() does not call mysql_library_end()
|
||||||
|
|
Loading…
Reference in New Issue