DatabaseMysql::~DatabaseMysql() { if (m_delayThread) HaltDelayThread(); if (mMysql) mysql_close(mMysql); // Free Mysql library pointers for last ~DB if (--db_count == 0) mysql_library_end(); }
DatabasePostgre::~DatabasePostgre() { if (m_delayThread) HaltDelayThread(); if( mPGconn ) { PQfinish(mPGconn); mPGconn = NULL; } }
void Database::StopServer() { HaltDelayThread(); delete m_pResultQueue; delete m_pAsyncConn; m_pResultQueue = nullptr; m_pAsyncConn = nullptr; for (size_t i = 0; i < m_pQueryConnections.size(); ++i) delete m_pQueryConnections[i]; m_pQueryConnections.clear(); }
void Database::StopServer() { HaltDelayThread(); /*Delete objects*/ if (m_pResultQueue) { delete m_pResultQueue; m_pResultQueue = NULL; } if (m_pAsyncConn) { delete m_pAsyncConn; m_pAsyncConn = NULL; } for (size_t i = 0; i < m_pQueryConnections.size(); ++i) delete m_pQueryConnections[i]; m_pQueryConnections.clear(); }