• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! 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