aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.cpp')
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index 8b24f508331..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()
@@ -112,7 +114,7 @@ bool MySQLConnection::Open()
else // generic case
{
port = atoi(m_connectionInfo.port_or_socket.c_str());
- unix_socket = 0;
+ unix_socket = nullptr;
}
#endif