- Joined
- May 24, 2005
- Messages
- 609
Hey there,
let's say I've got a function like this:
Usually, I'd nullify a unit variable. However, in this case I can't because it needs to be returned. So I cannot use 'set unit = null' at the bottom.
In summaray, I'm afraid this might leak, because u isn't nullified.
Anyone knows what's right here? Should I use a global variable instead?
Thanks
let's say I've got a function like this:
Code:
function GetUnit takes nothing returns unit
local unit u
set u = ... whatever
return u
// set unit = null
endfunction
Usually, I'd nullify a unit variable. However, in this case I can't because it needs to be returned. So I cannot use 'set unit = null' at the bottom.
In summaray, I'm afraid this might leak, because u isn't nullified.
Anyone knows what's right here? Should I use a global variable instead?
Thanks