New SQL locking on each query (fixes #1430)

This commit is contained in:
def 2019-01-14 22:28:13 +01:00
parent c665cabc27
commit 5ddcf8bd0c

View file

@ -72,7 +72,7 @@ CSqlServer::~CSqlServer()
bool CSqlServer::Connect()
{
m_SqlLock.take();
scope_lock LockScope(&m_SqlLock);
if (m_pDriver != NULL && m_pConnection != NULL)
{
@ -99,7 +99,6 @@ bool CSqlServer::Connect()
dbg_msg("sql", "Unknown Error cause by the MySQL/C++ Connector");
}
m_SqlLock.release();
dbg_msg("sql", "ERROR: SQL connection failed");
return false;
}
@ -162,13 +161,11 @@ bool CSqlServer::Connect()
}
dbg_msg("sql", "ERROR: sql connection failed");
m_SqlLock.release();
return false;
}
void CSqlServer::Disconnect()
{
m_SqlLock.release();
}
void CSqlServer::CreateTables()