• 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.

[JASS] Sound Leak

Status
Not open for further replies.
Level 17
Joined
Apr 27, 2008
Messages
2,455
KillSoundWhenDone works as expected, it destroys the sound when it is finished to be played.
Now, i've heard about bugs with sounds, like it's not played if you create and play it in the same thread, or without any delay, something like that.
But i've never played that much with sounds, just enough to ensure that KillSoundWhenDone works.
 
Level 13
Joined
Sep 13, 2010
Messages
550
Exactly my problem is KillSoundWhenDone is not working as it should do, nor StopSound. I keep tracking handle counts, but every time I play a sound handle's count increasing. Same with your system maggy... Leaks same as my 10 line code :p Also you know my opinion of all vJass structs and other shitz :p I'd never use them :p
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
You know that a local handle variable has to be nulled ? (function parameters are not concerned by this bug)
Else you will leak an handle id when the handle will be destroyed, just as you are describing.

EDIT : Oh wait, i remember that sounds are not played if wc3 volume is disabled (tested with TriggerWaitForSound), so the sound is probably not destroyed in this case, and in any other case when the sound is not played (probably player lag, wc3 minimized, ...)
 
Level 13
Joined
Sep 13, 2010
Messages
550
You know that a local handle variable has to be nulled ? (function parameters are not concerned by this bug)
Else you will leak an handle id when the handle will be destroyed, just as you are describing.

Of course I know and also I do remove those leaks

EDIT for your EDIT: I have sound enabled, but I think that is only for musics... I am not sure.
The problem is not that sound is not being played, problem is that it not gets removed.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
EDIT for your EDIT: I have sound enabled, but I think that is only for musics... I am not sure.

Basically, if you hear the sound it should be fine.

But because the sound is a local thing, we can say that KillSoundWhenDone can't be safely used, i mean sometimes it will just not work since the sound won't be played, so yeah using a stack of sound seems the only way to go.
 
Status
Not open for further replies.
Top