Memory Leak Problem

Status
Not open for further replies.
Level 18
Joined
Sep 14, 2012
Messages
3,413
Why not upload part of code that you think they are leaky ?
See some topics that talk about leaks ;)
Udg vars group are created in the map generation. Dont overcreate them.
Dont instanciate a local to null it is null when it is created.
For god's sakes what is the purpose of this code xD ?

Anyway you have to null every handle local in the end of the function they are created (handle : unit, player, item, location, group, ect... )
You don't have to instanciate vars to null.
Don't overcreate groups.
 
Level 2
Joined
Sep 9, 2013
Messages
8
according to syntax checker

in this code

JASS:
function Trig_Tahvil_Actions takes nothing returns nothing
	
	set udg_group10=GetUnitsInRectAll(udg_rect08)
	if(Trig_Tahvil_Func002C())then
		call UnitAddAbility(udg_unit22,'A00A')
		call SetUnitAbilityLevelSwapped('A00A',udg_unit22,udg_integer09)
		set udg_integer02=('n'(25+(GetUnitLevel(udg_unit01)*25)))
		call AdjustPlayerStateBJ(udg_integer02,Player(0),PLAYER_STATE_RESOURCE_GOLD)
		set udg_location09=GetUnitLoc(udg_unit02)
		call CreateTextTagLocBJ(I2S(udg_integer02),udg_location09,100.,20.,100.,88.,.0,0)
		call SetTextTagVelocityBJ(bj_lastCreatedTextTag,64,90)
		call SetTextTagPermanentBJ(bj_lastCreatedTextTag,false)
		call SetTextTagLifespanBJ(bj_lastCreatedTextTag,2.)
		call SetTextTagFadepointBJ(bj_lastCreatedTextTag,2.)
		call DisableTrigger(udg_trigger135)
		call DisableTrigger(udg_trigger136)
		call DestroyLightning(udg_lightning01)
		call DisableTrigger(GetTriggeringTrigger())
		set udg_location07=GetRandomLocInRect(udg_rect11)
		call SetUnitPositionLoc(udg_unit01,udg_location07)
		call SetUnitInvulnerable(udg_unit01,true)
		call AddHeroXPSwapped((R2I(GetUnitStateSwap(UNIT_STATE_LIFE,udg_unit01))/R2I(1.5)),udg_unit22,true)
		call RemoveLocation(udg_location07)
		call RemoveLocation(udg_location09)
		call DestroyGroup(udg_group10)
	endif
endfunction

the line

set udg_integer02=('n'(25+(GetUnitLevel(udg_unit01)*25)))

have problem
 
Status
Not open for further replies.
Top