I'm writing a stupidly complex set of jass scripts and tried to prevent as many leaks as possible. However, I'm concerned there's some really simple things that could leak. Like, is there a difference between the two test functions below?
And what about ignoring return values? I remember seeing that parameters don't need to be nulled, but do returns?
For example, would this code leak?
Code:
function cache takes nothing returns gamecache
return udg_mycache
endfunction
function testA takes string s returns nothing
call StoreString(cache(), "something", "else", s)
endfunction
function testB takes string s returns nothing
local gamecache g = cache()
call StoreString(g, "something", "else", s)
set g = null
endfunction
And what about ignoring return values? I remember seeing that parameters don't need to be nulled, but do returns?
For example, would this code leak?
Code:
call UnitRemoveItem(udg_a, UnitAddItem(udg_a, 'I000'))