mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
New SQL locking on each query (fixes #1430)
This commit is contained in:
parent
c665cabc27
commit
5ddcf8bd0c
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue