[12079] Remove some redundant explicit NULL checks for pointers before delete or delete[] calls since this check is done implicitly when deleting

Signed-off-by: stfx <stfx@hotmail.de>
This commit is contained in:
Machiavelli 2012-08-03 14:29:04 +02:00 committed by stfx
parent 4a684fe630
commit 21a3ee9267
28 changed files with 80 additions and 160 deletions

View file

@ -150,24 +150,17 @@ bool Database::Initialize(const char* infoString, int nConns /*= 1*/)
void Database::StopServer()
{
HaltDelayThread();
/*Delete objects*/
if (m_pResultQueue)
{
delete m_pResultQueue;
m_pResultQueue = NULL;
}
if (m_pAsyncConn)
{
delete m_pAsyncConn;
m_pAsyncConn = NULL;
}
delete m_pResultQueue;
delete m_pAsyncConn;
m_pResultQueue = NULL;
m_pAsyncConn = NULL;
for (size_t i = 0; i < m_pQueryConnections.size(); ++i)
delete m_pQueryConnections[i];
m_pQueryConnections.clear();
}
SqlDelayThread* Database::CreateDelayThread()
@ -644,9 +637,6 @@ SqlTransaction* Database::TransHelper::detach()
void Database::TransHelper::reset()
{
if (m_pTrans)
{
delete m_pTrans;
m_pTrans = NULL;
}
delete m_pTrans;
m_pTrans = NULL;
}