mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/PetAI: Fix memory leak
Fix memory leak added in e7f0808d46
Valgrind log:
395,712 (390,216 direct, 5,496 indirect) bytes in 229 blocks are definitely lost in loss record 65 of 67
at operator new(unsigned long) (vg_replace_malloc.c:320)
by PetAI::UpdateAI(unsigned int) (PetAI.cpp:167)
by Creature::Update(unsigned int) (Creature.cpp:541)
by TempSummon::Update(unsigned int) (TemporarySummon.cpp:47)
This commit is contained in:
@@ -183,7 +183,11 @@ void PetAI::UpdateAI(uint32 diff)
|
||||
}
|
||||
|
||||
if (spellInfo->HasEffect(SPELL_EFFECT_JUMP_DEST))
|
||||
{
|
||||
if (!spellUsed)
|
||||
delete spell;
|
||||
continue; // Pets must only jump to target
|
||||
}
|
||||
|
||||
// No enemy, check friendly
|
||||
if (!spellUsed)
|
||||
|
||||
Reference in New Issue
Block a user