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

Also fixes a memory leak in .reload creature_template command

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-21 23:20:58 +02:00
parent 5c86cc2aee
commit 95ddfbd9e2
19 changed files with 47 additions and 94 deletions
+1 -2
View File
@@ -120,8 +120,7 @@ m_LastPingTime(ACE_Time_Value::zero)
WorldSocket::~WorldSocket (void)
{
if (m_RecvWPct)
delete m_RecvWPct;
delete m_RecvWPct;
if (m_OutBuffer)
m_OutBuffer->release();
+3 -7
View File
@@ -84,8 +84,7 @@ class ReactorRunnable : protected ACE_Task_Base
Stop();
Wait();
if (m_Reactor)
delete m_Reactor;
delete m_Reactor;
}
void Stop()
@@ -220,11 +219,8 @@ WorldSocketMgr::WorldSocketMgr() :
WorldSocketMgr::~WorldSocketMgr()
{
if (m_NetThreads)
delete [] m_NetThreads;
if (m_Acceptor)
delete m_Acceptor;
delete [] m_NetThreads;
delete m_Acceptor;
}
int