mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Resolve shutdown crash/leak if MySQL server is not running
Fixes #12734
This commit is contained in:
@@ -57,12 +57,14 @@ m_connectionFlags(CONNECTION_ASYNC)
|
||||
|
||||
MySQLConnection::~MySQLConnection()
|
||||
{
|
||||
ASSERT (m_Mysql); /// MySQL context must be present at this point
|
||||
|
||||
for (size_t i = 0; i < m_stmts.size(); ++i)
|
||||
delete m_stmts[i];
|
||||
|
||||
mysql_close(m_Mysql);
|
||||
if (m_Mysql)
|
||||
mysql_close(m_Mysql);
|
||||
|
||||
if (m_worker)
|
||||
delete m_worker;
|
||||
}
|
||||
|
||||
void MySQLConnection::Close()
|
||||
|
||||
Reference in New Issue
Block a user