Skip to content

Commit 4154e9e

Browse files
authored
[GEN][ZH] Fix memory leak in SpecialAbilityUpdate::isWithinStartAbilityRange() (#845)
1 parent 0395987 commit 4154e9e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ Bool SpecialAbilityUpdate::isWithinStartAbilityRange() const
776776
PartitionFilterLineOfSight filterLOS( self );
777777
PartitionFilter *filters[] = { &filterLOS, NULL };
778778
ObjectIterator *iter = ThePartitionManager->iterateObjectsInRange( self, range, FROM_BOUNDINGSPHERE_2D, filters, ITER_SORTED_NEAR_TO_FAR );
779+
MemoryPoolObjectHolder hold(iter);
779780
for( Object *theTarget = iter->first(); theTarget; theTarget = iter->next() )
780781
{
781782
//LOS check succeeded.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ Bool SpecialAbilityUpdate::isWithinStartAbilityRange() const
880880
PartitionFilterLineOfSight filterLOS( self );
881881
PartitionFilter *filters[] = { &filterLOS, NULL };
882882
ObjectIterator *iter = ThePartitionManager->iterateObjectsInRange( self, range, FROM_BOUNDINGSPHERE_2D, filters, ITER_SORTED_NEAR_TO_FAR );
883+
MemoryPoolObjectHolder hold(iter);
883884
for( Object *theTarget = iter->first(); theTarget; theTarget = iter->next() )
884885
{
885886
//LOS check succeeded.

0 commit comments

Comments
 (0)