• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Memory Leaks

Status
Not open for further replies.
Level 6
Joined
Sep 11, 2006
Messages
172
I have some questions about fixing memory leaks. I am working on a big map right now that uses a bunch of looping triggers that call unit groups and use a lot of different positions. The unit group triggers are proabably where the biggest leaks are right now. I only know GUI so im not even sure I fix the leaks without jass.

Here's one of my current triggers:
[TRIGGER=GUI Trigger]
Test Alien Behavior
Events
Player - Player 1 (Red) types a chat message containing study aliens as An exact match
Conditions
Actions
Unit Group - Pick every unit in (Units owned by Player 11 (Dark Green)) and do (Unit Group - Add (Picked unit) to SearchAlien)
Unit Group - Pick every unit in (Units of type Lancer Drone) and do (Unit Group - Add (Picked unit) to LancerPatrol)
Unit Group - Pick every unit in (Units of type Kamikazee Drone) and do (Unit Group - Add (Picked unit) to KamikazeePatrol)
[/TRIGGER]

Here is another version of the trigger I think would fix the leaks:

[TRIGGER=GUI Trigger]
Test Alien Behavior Leaks Fixed
Events
Player - Player 1 (Red) types a chat message containing study aliens as An exact match
Conditions
Actions
Set DestroyGroup = (Units owned by Player 11 (Dark Green))
Unit Group - Pick every unit in DestroyGroup and do (Unit Group - Add (Picked unit) to SearchAlien)
Call Customscript (something in Jass that destroys udg_DestroyGroup)
Set DestroyGroup = (Units of type Lancer Drone)
Unit Group - Pick every unit in DestroyGroup and do (Unit Group - Add (Picked unit) to LancerPatrol)
Call Customscript (something in Jass that destroys udg_DestroyGroup)
Set DestroyGroup = (Units of type Kamikazee Drone)
Unit Group - Pick every unit in DestroyGroup and do (Unit Group - Add (Picked unit) to KamikazeePatrol)
Call Customscript (something in Jass that destroys udg_DestroyGroup)
[/TRIGGER]

Like I said though, I don't have much experience with Jass and I don't know how I would wright the custom script that destroys the unit group. If anyone has an idea of how can fix these mem leaks, please post back. My map's gonna be awsome, but I can't even play it if there's constant lag!:eekani:
 
Last edited by a moderator:
Status
Not open for further replies.
Top