put lines back preventing double open of mysql

pull/2090/head^2
Isaac Connor 2018-04-23 13:48:14 -04:00
parent e3161687ba
commit a110ae71f5
1 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,6 @@
#include "zm.h"
#include "zm_db.h"
// From what I read, we need one of these per thread
MYSQL dbconn;
Mutex db_mutex;
@ -31,8 +30,9 @@ bool zmDbConnected = false;
bool zmDbConnect() {
// For some reason having these lines causes memory corruption and crashing on newer debian/ubuntu
//if ( zmDbConnected )
//return;
// But they really need to be here in order to prevent a double open of mysql
if ( zmDbConnected )
return true;
if ( !mysql_init(&dbconn) ) {
Error("Can't initialise database connection: %s", mysql_error(&dbconn));