Warcraft III resources & community, 2003–2006 · archived

o oh its leaking

6 posts
#1

o oh its leaking

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:
#2
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.
#3

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?
#4
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.
#5

tx

well tx for all the help but heres a good one for you

the script it suggested to fix my point problems wont allow me to use Call RemoveLocation(udg_point1) to get rid of my points
#6
so don't use it. (-.-)