Core/Misc: Fix some mem-leaks and uninitialized variables.
This commit is contained in:
@@ -57,7 +57,8 @@ BattlegroundIC::BattlegroundIC()
|
||||
|
||||
BattlegroundIC::~BattlegroundIC()
|
||||
{
|
||||
|
||||
delete gunshipHorde;
|
||||
delete gunshipAlliance;
|
||||
}
|
||||
|
||||
void BattlegroundIC::HandlePlayerResurrect(Player* player)
|
||||
|
||||
@@ -276,14 +276,9 @@ public:
|
||||
std::ostringstream stream;
|
||||
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' '
|
||||
<< m_auiEncounter[4] << ' ' << m_auiEncounter[5];
|
||||
char* out = new char[stream.str().length() + 1];
|
||||
strcpy(out, stream.str().c_str());
|
||||
if (out)
|
||||
{
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return out;
|
||||
}
|
||||
return NULL;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
|
||||
@@ -180,12 +180,13 @@ class instance_zulaman : public InstanceMapScript
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << "S " << BossKilled << ' ' << ChestLooted << ' ' << QuestMinute;
|
||||
char* data = new char[ss.str().length()+1];
|
||||
strcpy(data, ss.str().c_str());
|
||||
//sLog->outError(LOG_FILTER_TSCR, "Zul'aman saved, %s.", data);
|
||||
return data;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Load(const char* load)
|
||||
|
||||
@@ -119,6 +119,18 @@ public:
|
||||
void Initialize()
|
||||
{
|
||||
GahzRillaEncounter = NOT_STARTED;
|
||||
ZumrahGUID = 0;
|
||||
BlyGUID = 0;
|
||||
WeegliGUID = 0;
|
||||
OroGUID = 0;
|
||||
RavenGUID = 0;
|
||||
MurtaGUID = 0;
|
||||
EndDoorGUID = 0;
|
||||
PyramidPhase = 0;
|
||||
major_wave_Timer = 0;
|
||||
minor_wave_Timer = 0;
|
||||
addGroupSize = 0;
|
||||
waypoint = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
|
||||
-2
@@ -219,8 +219,6 @@ public:
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
Creature* pMemory;
|
||||
uint64 MemoryGUID;
|
||||
|
||||
bool bHealth;
|
||||
|
||||
@@ -190,16 +190,12 @@ public:
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::string str_data;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D K " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
|
||||
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
boss_ingvar_the_plundererAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
bIsUndead = false;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
@@ -171,6 +171,7 @@ public:
|
||||
summonTraveler_Timer = 90000;
|
||||
banish_Timer = 17000;
|
||||
HelpYell = false;
|
||||
sumportals = false;
|
||||
destroyPortals();
|
||||
|
||||
if (instance)
|
||||
|
||||
@@ -200,16 +200,12 @@ public:
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
char* out = new char[stream.str().length() + 1];
|
||||
strcpy(out, stream.str().c_str());
|
||||
if (out)
|
||||
{
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return out;
|
||||
}
|
||||
return NULL;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
|
||||
@@ -171,15 +171,9 @@ public:
|
||||
OUT_SAVE_INST_DATA;
|
||||
std::ostringstream stream;
|
||||
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1];
|
||||
char* out = new char[stream.str().length() + 1];
|
||||
strcpy(out, stream.str().c_str());
|
||||
if (out)
|
||||
{
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return out;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
|
||||
@@ -166,16 +166,12 @@ class instance_the_eye : public InstanceMapScript
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
char* out = new char[stream.str().length() + 1];
|
||||
strcpy(out, stream.str().c_str());
|
||||
if (out)
|
||||
{
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return out;
|
||||
}
|
||||
return NULL;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
|
||||
Reference in New Issue
Block a user