Resolve shutdown crash/leak if MySQL server is not running

Fixes #12734
This commit is contained in:
leak
2014-08-10 20:28:18 +02:00
parent 9aea8046ce
commit 14cb6e4235
3 changed files with 81 additions and 44 deletions

View File

@@ -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()