backport change to not initialize db in logger which fixes small memleak.

This commit is contained in:
Isaac Connor 2021-03-31 12:05:30 -04:00
parent 790cdf879a
commit 4fb73505b9
2 changed files with 3 additions and 1 deletions

View File

@ -43,6 +43,8 @@ class zmDbRow {
extern MYSQL dbconn;
extern RecursiveMutex db_mutex;
extern bool zmDbConnected;
bool zmDbConnect();
void zmDbClose();

View File

@ -361,7 +361,7 @@ Logger::Level Logger::databaseLevel(Logger::Level databaseLevel) {
databaseLevel = limit(databaseLevel);
if ( mDatabaseLevel != databaseLevel ) {
if ( (databaseLevel > NOLOG) && (mDatabaseLevel <= NOLOG) ) { // <= NOLOG would be NOOPT
if ( !zmDbConnect() ) {
if ( !zmDbConnected ) {
databaseLevel = NOLOG;
}
} // end if ( databaseLevel > NOLOG && mDatabaseLevel <= NOLOG )