• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Trigger] Memory Leak Question

Status
Not open for further replies.
Level 10
Joined
May 20, 2008
Messages
433
This may be a stupid question, but I'm asking anyway. Does destroying a variable preventing a leak permanently delete it permanently?

For those who require an example:
  • Ping Quest
    • Events
      • Player - Player 1 (Red) types a chat message containing -Ping as An exact match
    • Conditions
      • Sensor_Enabled Equal to True
    • Actions
      • Cinematic - Ping minimap for Player Group - Player 1 (Red) at Quest_Ping for 5.00 seconds, using a Simple ping of color (10.00%, 100.00%, 10.00%)
*Quest_Ping is set in a different trigger*
By adding
  • Custom script: call RemoveLocation(udg_Quest_Ping)
Would that destroy the variable ending in a broken trigger when player 1 activates the trigger again?

And on the same subject, would sounds still leak if they are destroyed in another trigger (by experience, destroying them in the same trigger prevents the sound from being replayed).
 
Level 6
Joined
Jan 31, 2009
Messages
166
No the variable can be used again because you are destroying the point in memory not the variable that holds it. Destroying it in another trigger is usualy bad idea because it will leak if the variable is set too something else. (eg if you had a trigger that deleted the Quest_Ping variable every 5 seconds and red used -ping twice then you would get an un deletable leaked point).

Hope that helps (I don't have world editor handy or id make an example)
 
Level 10
Joined
May 20, 2008
Messages
433
Destroying it in another trigger is usualy bad idea because it will leak if the variable is set too something else.

The sound being played/destroyed is part of a series of triggers that activate as you enter regions (u enter region1, sound plays, region2 sound plays...etc). The final region you enter plays the sound and destroys it. I originally had it so that once you entered the region, it would play and destroy the sound, but once i entered region2, it wouldn't play. Upon deleting the "destroy sound" trigger, it worked again. I would post my triggers, but it comes in 5 fairly long triggers.
And thanks for the other bits of help.
 
Level 10
Joined
May 20, 2008
Messages
433
If it's just a normal game sound, you don't need to destroy it.

Like if you use Blademaster's taunt voiceclip over and over, you are not causing a memory leak. Those are global values. That post in the memory leak section about destroying sounds? I wish it wasn't there, because it's misleading. That doesn't concern 99% of sounds.

I'm using the battle.netdoorstereo sound or whatever its called (battle.net door close, not the normal ingame sounds.
 
Status
Not open for further replies.
Top