[JASS] take handle leak?

Level 3
Joined
Mar 20, 2008
Messages
27
Its a simple question,
JASS:
function one takes dialog d returns nothing
//actions
endfunction

function two takes nothing returns nothing
local dialog d = DialogCreate()
endfunction
in functions one does "d" leak
If i clean "d" in function two will it still work in function one and not leak?
 
Level 11
Joined
Feb 22, 2006
Messages
752
Uh...function one won't create a reference leak if that's what you mean (parameters never create reference leaks).

If by clean the leak you mean destroy the dialog, obviously it won't won't anywhere anymore since it will be gone. If, on the other hand, you mean null the local, then yes, as long as the dialog still exists you can operate on it in other functions since nulling handle variables only dereferences them; it doesn't destroy the handle that they point to.
 
Top