• 🏆 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!

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