• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Question about leaks

Status
Not open for further replies.
Level 4
Joined
Dec 13, 2010
Messages
70
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