Quick Leak concept help

neckface

terrain contest winner! :) dance contest loser. :(
Reaction score
34
Code:
ACTIONS
set tempLocation = position of triggering unit
create dummy at tempLocation 
...(actions)
create second dummy at tempLocation
...(actions)
create third dummy at tempLocation
(actions)
custom script: call RemoveLocation (udg_tempLocation)

is it ok to RemoveLocation only at the end, or must i do it after each unit is created and reset the variable?
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Since it's the same location you can remove it at the end. Though if you were to set that very variable to a new value you'd have to remove it before doing that.
 

neckface

terrain contest winner! :) dance contest loser. :(
Reaction score
34
ok so it is the setting of the variable that causes the leak... got it! :thup:
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
It's the reference to the location that's causing the leak. Setting it to a variable allows you to do stuff with that location that you normally wouldn't be able to do since it would be lost. The RemoveLocation() removes that location, while if it would not be set to a variable the reference would be lost, hence a memory leak.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top