Possibly fixed more memory leaks in other places.

--HG--
branch : trunk
This commit is contained in:
raczman
2009-05-13 14:06:33 +02:00
parent 5748c36621
commit bfaaa8201e
6 changed files with 20 additions and 3 deletions

View File

@@ -1323,6 +1323,7 @@ Creature* BattleGround::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
if(!pCreature->IsPositionValid())
{
sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to battleground. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
delete pCreature;
return NULL;
}

View File

@@ -766,6 +766,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
FillSystemMessageData(&data, line);
sWorld.SendGlobalGMMessage(&data);
}
delete buf;
}
void ChatHandler::SendSysMessage(int32 entry)

View File

@@ -3827,6 +3827,9 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
// Everything looks OK, create new pet
Pet* pet = new Pet(HUNTER_PET);
if(!pet)
return false;
if(!pet->CreateBaseAtCreature(creatureTarget))
{
delete pet;
@@ -3846,6 +3849,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
{
sLog.outError("ERROR: InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
PSendSysMessage("Error 2");
delete pet;
return false;
}

View File

@@ -4124,7 +4124,11 @@ void ObjectMgr::LoadGossipText()
pGText->Options[i].Emotes[2]._Emote = fields[cic++].GetUInt32();
}
if ( !pGText->Text_ID ) continue;
if ( !pGText->Text_ID ){
delete pGText;
continue;
}
AddGossipText( pGText );
} while( result->NextRow() );

View File

@@ -170,6 +170,7 @@ bool OutdoorPvPObjective::AddCreature(uint32 type, uint32 entry, uint32 teamval,
if(!pCreature->IsPositionValid())
{
sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
delete pCreature;
return false;
}
@@ -283,6 +284,7 @@ bool OutdoorPvPObjective::AddCapturePoint(uint32 entry, uint32 map, float x, flo
if(!pCreature->IsPositionValid())
{
sLog.outError("ERROR: Creature (guidlow %d, entry %d) not added to opvp. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY());
delete pCreature;
return false;
}

View File

@@ -200,8 +200,13 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId)
// he dropped it further, summon mound
GameObject * go = new GameObject;
Map * map = MapManager::Instance().GetMap(plr->GetMapId(), plr);
if(!map)
return true;
if(!map){
delete go;
return true;
}
if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map,plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,1))
{
delete go;