Leak Checking n.2

pride2518

New Member
Reaction score
4
Hey, can anyone tell me if this trigger contains any leak?

Trigger:
  • Restr2
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Exterminator
      • (Unit-type of (Attacked unit)) Not equal to Fiend
    • Actions
      • Unit - Replace (Attacked unit) with a (Unit-type of (Attacked unit)) using The old unit's relative life and mana
 

Jedi

New Member
Reaction score
63
No, but some people will tell use triggering unit instead of attacked unit.
 

Skippy

Active Member
Reaction score
39
JASS:
function GetAttackedUnitBJ takes nothing returns unit
    return GetTriggerUnit()
endfunction

This is the reason: Attacked unit is basically a BJ function that returns Triggering unit

On topic: What causes leaks? "Forgotten" handles, like points or groups (or timers or triggers ... ) or some spawned and undestroyed things, like dummy units or special effects.
 

Azylaminaz

Vox Populi
Reaction score
91
>>"Forgotten" handles

Sort of that... When you set a variable to a value, if it is an object type (IE, has a handle), it creates space in RAM... even if it already has been given space before. If you don't specifically empty this space (clear and null the variable), the space just remains.

Points, groups, forces, units, special effects are all objects which have handles..

You can basically find anything that 'leaks' by seeing if it has a destroy or remove function.


Using BJs, most of the time, just requires more power. There are a few BJs that actually do stuff, though...
 
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