• 🏆 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!

[JASS] take handle leak?

Status
Not open for further replies.
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.
 
Status
Not open for further replies.
Top