• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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