• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

o oh its leaking

Status
Not open for further replies.
Level 4
Joined
Sep 2, 2004
Messages
74
well my triggers are leaking up to high heaven and i have no idea how to fix it ive read a few threads and tutorials on um but it doesnt seem to help at all!! can somone a link a good tutoriel post how to do it or offer to fix it! :oops:
 
download the leak checker from this site. to use it simply right click your triggers and select "copy as text" and paste the triggers you want to check into a text file. save the file and load it into the leak checker and have the super-cool and EXTREMELY useful leak checker tell you where your problems lie.
 
woot a wut now?

(Number of units in (Units of type Need More Soul Shards (2))) Equal to 0
(Number of units in ^Leak
(Suggested fix) Custom Script: bj_wantDestroyGroup = true
(Suggested fix) (Number of units in (Units of type Need More Soul Shards (2))) Equal to 0

this is my leak that i got alot of im not sure how to fix

heres the orginal

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
(Line:10) If - Conditions
(Line:11) (Charges remaining in soulshard) Greater than or equal to 1
(Line:12) (Number of units in (Units of type Need More Soul Shards (2))) Equal to 0
(Line:13) Then - Actions


help?
 
leaks arise when you do not assign a variable to store the data you just generated. for example, the following action would cause a leak:

create 1 footman at (random point in spawn1)

in this action, memory is allocated but the game loses its handle on the memory immediately afterward, thus creating a memory leak. however, the following actions take care of that:

set point1 = (random point in spawn1)
create 1 footman at (point1)

in this action no new memory is allocated; instead, the location is stored in point1 and the handle on the memory is not lost. the next time the action executes, it will create a point that replaces the data in point1 without allocating any new memory.

for your particular memory leak i would suggest the following actions:

set group1 = (units of type Need More Soul Shards (2))
set num1 = (number of units in (group1))
if (num1 equal to 0)
//actions

in this way you are using the same memory locations every time you run the trigger, thus preventing a memory leak.
 
Status
Not open for further replies.
Back
Top