• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Memory Leaks

Status
Not open for further replies.
Level 4
Joined
Aug 7, 2004
Messages
7
i have latley been seriously concerned w/ the memory leaks in my map, and have read a tutorial on how to get rid of them, BUT one thing goes seriously wrong in my triggers; I basicly do the trigger like this:

EVENTS:-Unit starts the effect of an ability
CONDITIONS:-Ability being cast equal to <ABILITY>
ACTIONS:-Set Point_Generic = Position of casting unit
-Pick every unit within 300 of Point_Generic and do actions: Add unit to Group_Generic
-Pick every unit in Group Generic and do actions: <ACTIONS>
-Custom script: call RemoveLocation( udg_Point_Generic )
-Custom script: call DestroyGroup( udg_Group_Generic )

and it works ONCE and only once, I'm pretty sure the reason it only works once is that I completly destroy the point and group w/ the custom script, and the trigger runs more than once so it CANT find the variables....but if i leave out the custom script then I'll have a large amount of memory leaks, how can i "recycle" or "recall" the variables, is there an alternative GUI or custom script i can use that will allow the variables to be recycled?
 
Level 3
Joined
Mar 27, 2004
Messages
70
Try this:
Code:
ACTIONS:
-Set Point_Generic = Position of casting unit
-Clear Group_Generic
-Set Group_Generic = (Every unit within 300.00 of Point_Generic)
-Pick every unit in Group Generic and do actions: <ACTIONS>
-Custom script: call RemoveLocation( udg_Point_Generic )
 
Status
Not open for further replies.
Top