• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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