Exemplo n.º 1
0
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();
}
Exemplo n.º 2
0
DatabasePostgre::~DatabasePostgre()
{

    if (m_delayThread)
        HaltDelayThread();

    if( mPGconn )
    {
        PQfinish(mPGconn);
        mPGconn = NULL;
    }
}
Exemplo n.º 3
0
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();
}
Exemplo n.º 4
0
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();

}