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