aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.cpp
diff options
context:
space:
mode:
authorleak <leak@bitmx.net>2014-08-10 20:28:18 +0200
committerleak <leak@bitmx.net>2014-08-10 22:43:48 +0200
commit14cb6e4235ebb84ad41d6ceb4eaf56c0b55d9238 (patch)
treea4476afcf874ac1510130d01e02ada0725c50389 /src/server/shared/Database/MySQLConnection.cpp
parent9aea8046ce30515ea900c72b2a779c47bc6e7248 (diff)
Resolve shutdown crash/leak if MySQL server is not running
Fixes #12734
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.cpp')
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index e9fc20aef82..4e46ff0e3a1 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -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()