Question on Memory Leaks

Mindless

New Member
Reaction score
4
Hi everyone,

A quick question: does this leak?

Set LCPoint = (Position of Triggering Unit) offset by 15 in direction of (facing angle of Triggering Unit)
Unit - Move Triggering Unit to LCPoint Instantly
Custom Script - call RemoveLocation(udg_LCPoint)

Do I need to create a variable to store the Position of the Triggering Unit and clean it? Like:

Set LCPoint1 = (Position of Triggering Unit)
Set LCPoint2 = LCPoint1 offset by 15 in direction of (facing angle of Triggering Unit)
Unit - Move Triggering Unit to LCPoint2 Instantly
Custom Script - call RemoveLocation(udg_LCPoint1)
Custom Script - call RemoveLocation(udg_LCPoint2)

Any help would be appreciated.

P.S. It's really essential this peice doesn't leak, because I'll be running this trigger twenty times every second for every active player.
 

Romek

Super Moderator
Reaction score
963
The first one does leak.
(Position of Triggering Unit) returns one location. Then Position with Offset returns another. You need to destroy them both.
 

Mindless

New Member
Reaction score
4
Yeah I already read that tutorial; it's what started me getting concerned about memory leaks in the first place. However, even in the examples, there's not one that addresses my case: I have a set variable trigger line that has potential leaks. So still the question, does it leak?

EDIT: sorry, left the Helper Forum web page hanging for way too long! I was replying to WolfieeifloW. It was after I hit the reply button that I saw Romek's post. Thanks.
 
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