Memory Leak Question

Bloodydood

New Member
Reaction score
14
Now since using a single point can cause leaks, yet able to be fixed like so:

Trigger:
  • Single Point
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Temp_Point = (Center of (Playable map area))
      • Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_Temp_Point)


Is there a way to keep multiple points from leaking?

Trigger:
  • Multiple Points
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Temp_PointArray[(Integer A)] = (Random point in (Playable map area))
          • Unit - Create 1 Footman for Player 1 (Red) at Temp_PointArray[(Integer A)] facing Default building facing degrees
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well... Do you need to use those Temp_PointArray points later ? :S
Or only in that trigger ?
If only in that trigger, then you don't need to use an array, just use Temp_Point and remove it inside the loop :D
Like:
Trigger:
  • Multiple Points
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Random point in (Playable map area))
          • Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_Temp_Point)
 

Bloodydood

New Member
Reaction score
14
Trigger:
  • For each (Integer A) from 1 to Player_Count, do (Actions)
    • Loop - Actions
      • Set Temp_PointArray2[(Integer A)] = (Position of Hero[(Integer A)])


Player_Count being the predetermined integer of players both controlled by a User and Is Playing.

This is the problem. I want to save the positions of heroes before an event and then destroy those stored positions once the event is over and the heroes are moved back to their original places.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, as long as you don't use them in between when setting them, and destroying them (I mean setting the variable to something else) then it's ok :D
 

TheCrystal

New Member
Reaction score
36
Using Point Array wastes more time then having several individual TempPoints, writing up that script or finding it in a past trigger. The best thing [I would think] is to have several "Temp" things. I hope that Array has a max [below 8192], since I'm not sure how JASS and GUI variable differ (You never specify a max for an Array in JASS).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top