Does this leak?

afisakov

You can change this now in User CP.
Reaction score
37
would calling unit u cause a leak that needs to be cleaned up?
Code:
function CD_atk takes unit u returns nothing
  call GroupAddUnitSimple(u, udg_CoolingDown)
  call PolledWait(0.3)
  call GroupRemoveUnitSimple(u, udg_CoolingDown)
endfunction
...
call CD_atk(GetAttacker())
Tried to only include the relevant code.
Also, does the wait create a risk of desync?
 

jonas

You can change this now in User CP.
Reaction score
67
No. There is no handle leak since parameters do not create handle leaks. There is no regular leak because nothing is created.
 

afisakov

You can change this now in User CP.
Reaction score
37
Thank you.
I wanted to make sure I did not have to add
set u=null
at the end of it.
See that alot when people use local variables and do not fully understand.
 

jonas

You can change this now in User CP.
Reaction score
67
parameters do not create handle leaks
local variables create handle leaks
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top