HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Destroy anything in this trigger?

10-30-2005, 02:12 AM#1
The_AwaKening
I just want to make sure I don't need to destroy anything in this trigger as to avoid memory leaks.

Code:
Seiryuu Dies
    Events
        Unit - Seiryuu 0090 <gen> Dies
    Conditions
    Actions
        Trigger - Turn on Deeplord Dies <gen>
        Sound - Play monster_kill <gen>
        Set AwardsDragons[(Player number of (Owner of (Killing unit)))] = (AwardsDragons[(Player number of (Owner of (Killing unit)))] + 1)
        Player Group - Pick every player in (All allies of (Owner of (Killing unit))) and do (Actions)
            Loop - Actions
                Player - Add 1000 to (Picked player) Current gold
                Player - Add 300 to (Picked player) Current lumber
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Item - Remove (Item carried by (Picked unit) of type Summon Seiryuu))
        Item - Pick every item in (Playable map area) and do (If ((Item-type of (Picked item)) Equal to Summon Seiryuu) then do (Item - Remove (Picked item)) else do (Do nothing))
        Wait 2.00 game-time seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Killing unit)) Equal to Player 1 (Red)
                        (Owner of (Killing unit)) Equal to Player 2 (Blue)
                        (Owner of (Killing unit)) Equal to Player 3 (Teal)
            Then - Actions
                Game - Display to (All players) the text: |c007ebff1The Barba...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Killing unit)) Equal to Player 4 (Purple)
                        (Owner of (Killing unit)) Equal to Player 5 (Yellow)
                        (Owner of (Killing unit)) Equal to Player 6 (Orange)
            Then - Actions
                Game - Display to (All players) the text: |c00106246The Knigh...
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Owner of (Killing unit)) Equal to Player 7 (Green)
                        (Owner of (Killing unit)) Equal to Player 8 (Pink)
                        (Owner of (Killing unit)) Equal to Player 9 (Gray)
            Then - Actions
                Game - Display to (All players) the text: |c004e2a04 The Maur...
            Else - Actions
        Custom script:   call DestroyTrigger( GetTriggeringTrigger() )
10-30-2005, 09:13 AM#2
Anitarf
No, you don't need to destroy anything. The trigger runs only once, so the unit group and player group leaks it has are insignificant.
10-31-2005, 02:51 PM#3
Earth-Fury
Triggers that run once or twice can have memory leaks, but dont bother fixing them. (unless your coding in JASS anyway)

its triggers that are called often (spawning units, moving units, periodc events) that must be leak-proof.

Now, if your writing all your triggers in JASS, then fix every memory leak. (dont be lazy!) But when doing things in GUI, its much more of a pain to remove memory leaks, so only do it on important triggers.