• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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