mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
Fix for DBCore crash
This commit is contained in:
+3
-1
@@ -38,6 +38,7 @@ DBcore::DBcore() {
|
|||||||
pDatabase = 0;
|
pDatabase = 0;
|
||||||
pCompress = false;
|
pCompress = false;
|
||||||
pSSL = false;
|
pSSL = false;
|
||||||
|
pStatus = Closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBcore::~DBcore() {
|
DBcore::~DBcore() {
|
||||||
@@ -180,9 +181,10 @@ bool DBcore::Open(uint32* errnum, char* errbuf) {
|
|||||||
LockMutex lock(&MDatabase);
|
LockMutex lock(&MDatabase);
|
||||||
if (GetStatus() == Connected)
|
if (GetStatus() == Connected)
|
||||||
return true;
|
return true;
|
||||||
if (GetStatus() == Error)
|
if (GetStatus() == Error) {
|
||||||
mysql_close(&mysql);
|
mysql_close(&mysql);
|
||||||
mysql_init(&mysql); // Initialize structure again
|
mysql_init(&mysql); // Initialize structure again
|
||||||
|
}
|
||||||
if (!pHost)
|
if (!pHost)
|
||||||
return false;
|
return false;
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user