mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
fix(Core): Memleaks fixes - Part II. (#5760)
This commit is contained in:
@@ -19253,7 +19253,6 @@ void Player::_LoadMailedItems(Mail* mail)
|
||||
}
|
||||
|
||||
Item* item = NewItemOrBag(proto);
|
||||
|
||||
if (!item->LoadFromDB(itemGuid, ObjectGuid::Create<HighGuid::Player>(fields[13].GetUInt32()), fields, itemTemplate))
|
||||
{
|
||||
LOG_ERROR("server", "Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid);
|
||||
@@ -19319,6 +19318,13 @@ void Player::_LoadMail()
|
||||
itr = GetMailBegin();
|
||||
}
|
||||
|
||||
// Delete mailed items aswell
|
||||
// Created again below in Player::_LoadMailedItems
|
||||
for (ItemMap::iterator iter = mMitems.begin(); iter != mMitems.end(); ++iter)
|
||||
delete iter->second;
|
||||
|
||||
mMitems.clear();
|
||||
|
||||
//Now load the new ones
|
||||
m_mailCache.clear();
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL);
|
||||
|
||||
@@ -12688,11 +12688,11 @@ void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply,
|
||||
if (spellId == 0 && std::find_if(m_spellImmune[op].begin(), m_spellImmune[op].end(), spellIdImmunityPredicate(type)) != m_spellImmune[op].end())
|
||||
return;
|
||||
|
||||
SpellImmune Immune;
|
||||
Immune.spellId = spellId;
|
||||
Immune.type = type;
|
||||
Immune.blockType = blockType;
|
||||
m_spellImmune[op].push_back(Immune);
|
||||
SpellImmune immune;
|
||||
immune.spellId = spellId;
|
||||
immune.type = type;
|
||||
immune.blockType = blockType;
|
||||
m_spellImmune[op].push_back(std::move(immune));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -342,12 +342,14 @@ enum SpellImmuneBlockType
|
||||
|
||||
struct SpellImmune
|
||||
{
|
||||
SpellImmune() : spellId(0), type(IMMUNITY_EFFECT), blockType(SPELL_BLOCK_TYPE_ALL) { }
|
||||
|
||||
uint32 spellId;
|
||||
uint32 type : 16;
|
||||
uint32 blockType : 16;
|
||||
uint32 type;
|
||||
uint32 blockType;
|
||||
};
|
||||
|
||||
typedef std::list<SpellImmune> SpellImmuneList;
|
||||
typedef std::vector<SpellImmune> SpellImmuneList;
|
||||
|
||||
enum UnitModifierType
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user