Questions About Leaks

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
I'm usually pretty good about leaks, but I think I have one that I can't find.

Do the following things leak?

Does the above create a location that isn't destroyed?


JASS:
call TimerStart(GetExpiredTimer(), SpawnTimes[currentPlayer], false, function Spawn)

Does a timer get leaked here?


JASS:
exitwhen FirstOfGroup(temp) == null

Is a unit leaked here?


Basically my questions revolve around the concept of whether or not functions that return handles that aren't necessarily stored in a variable cause leaks.

Thanks for any help.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
What you should always do if you need a particular point several times... store it in some global on map init.
Even if it leaks there, it's once per map.

set StartX[1] = ...
...
set StartY[12] = ...
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Hm. Ok, I can do that. Thanks.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Does this still leak?

Seems I missed that part :p

GetStartLocationLoc was the problem as it creates a new location on every call.
Somewhat strange given start locations never change... but, well, ask Blizzard.

Still, why run all of those calls if a simple array solves all problems in one simple go?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> it creates a new location on every call.

That's what I was thinking, but I wasn't sure.
Anyway, it should be fixed now. I have two real arrays to take care of it.
 
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