• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Question about leaks

Status
Not open for further replies.
Level 4
Joined
Dec 13, 2010
Messages
71
When I do something like this:

JASS:
function Actions takes nothing returns nothing
    local location Loc
    local integer i = 1
    loop
        if stuff then
            set Loc = blabla
            call RemoveLocation(Loc)
        endif
        set i = i + 1
    endloop
    
endfunction

So when "stuff" is always false, would I still need to call Removelocation(Loc) at the end of the function, even if Loc wasn't used yet?
So the general question about that would be:
Do I have to remove leakable stuff if it was only declared, but not defined?
 
Status
Not open for further replies.
Top