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
+7 -10
View File
@@ -1241,11 +1241,11 @@ bool GridMap::loadData(char *filename)
void GridMap::unloadData()
{
if (m_area_map) delete[] m_area_map;
if (m_V9) delete[] m_V9;
if (m_V8) delete[] m_V8;
if (m_liquid_type) delete[] m_liquid_type;
if (m_liquid_map) delete[] m_liquid_map;
delete[] m_area_map;
delete[] m_V9;
delete[] m_V8;
delete[] m_liquid_type;
delete[] m_liquid_map;
m_area_map = NULL;
m_V9 = NULL;
m_V8 = NULL;
@@ -2350,11 +2350,8 @@ InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 Spaw
InstanceMap::~InstanceMap()
{
if (i_data)
{
delete i_data;
i_data = NULL;
}
delete i_data;
i_data = NULL;
}
void InstanceMap::InitVisibilityDistance()