From 484827bdeb34b6efe46e2cb1c041f44aad6265a0 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 20 Feb 2022 10:32:40 -0500 Subject: [PATCH] Should get lock before testing for connected --- src/zm_db.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zm_db.cpp b/src/zm_db.cpp index 7224241b4..7db61e157 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -107,8 +107,8 @@ bool zmDbConnect() { } void zmDbClose() { + std::lock_guard lck(db_mutex); if (zmDbConnected) { - std::lock_guard lck(db_mutex); mysql_close(&dbconn); // mysql_init() call implicitly mysql_library_init() but // mysql_close() does not call mysql_library_end()