Removing leaks that wont actually leak

Incognito

Member
Reaction score
1
In the case bellow would it leak?
As the Temp is only set once obviously I don’t see why it should.

Set Temp Integer to (random between 1 and 3)
If Temp Integer is 1
Set (Temp Point) to (point 1)
Do something at (Temp Point)
If Temp Integer is 2
Set (Temp Point) to (point 2)
Do something at (Temp Point)
If Temp Integer is 3
Set (Temp Point) to (point 3)
Do something at (Temp Point)
Custom Script Remove (Temp Point)


The above is what I ended up with fixing the scripts myself but recently I decided id check everything with 56ks Leak Checker which says that the variables are not removed., would I need to remove after each declaration of the variables even if they wont actually happen?

On a side note 56ks leak checker seems to let me know that Temp Integer is not removed each time I use it, obviously it doesn’t stat that it is a leak but the mentioning made me wonder if I should removed the Temp Integer (an integer variable) each time after use, would I need to?
 

Moridin

Snow Leopard
Reaction score
144
Temp Integer doesn't leak. Integers don't leak.

As long as your temp Point removal is after all the ifs (and not in any of the ifs) then this trigger is leakless.
As long as you don't set the variable again, it doesn't 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