*Add some checks during object deconstruction.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-03 16:28:15 -06:00
parent c48ea87a03
commit 34f9778296
4 changed files with 9 additions and 3 deletions
+2
View File
@@ -94,6 +94,8 @@ Object::~Object( )
assert(false);
}
assert(!m_objectUpdated);
//DEBUG_LOG("Object desctr 1 check (%p)",(void*)this);
delete [] m_uint32Values;
delete [] m_uint32Values_mirror;
+1 -1
View File
@@ -69,7 +69,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
{
//If a pet is dismissed, m_Controlled will change
std::vector<Unit*> controlled;
for(ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
for(Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
if((*itr)->GetEntry() == pet->GetEntry() && (*itr)->isAlive())
controlled.push_back(*itr);
for(std::vector<Unit*>::iterator itr = controlled.begin(); itr != controlled.end(); ++itr)
+5
View File
@@ -187,6 +187,11 @@ Unit::~Unit()
RemoveAllDynObjects();
if(m_charmInfo) delete m_charmInfo;
assert(!m_attacking);
assert(m_attackers.empty());
assert(m_sharedVision.empty());
assert(m_Controlled.empty());
}
void Unit::Update( uint32 p_time )
+1 -2
View File
@@ -847,12 +847,11 @@ struct AuraSlotEntry
struct SpellProcEventEntry; // used only privately
typedef std::set<Unit*> ControlList;
class TRINITY_DLL_SPEC Unit : public WorldObject
{
public:
typedef std::set<Unit*> AttackerSet;
typedef std::set<Unit*> ControlList;
typedef std::pair<uint32, uint8> spellEffectPair;
typedef std::multimap< spellEffectPair, Aura*> AuraMap;
typedef std::list<Aura *> AuraList;