Should get lock before testing for connected
This commit is contained in:
parent
aaf391fc65
commit
484827bdeb
|
@ -107,8 +107,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