MIX_DestroyTrack(3)
β¨ MIX_DestroyTrack β¨
okay bestie, welcome to MIX_DestroyTrack(3) β it's a page from the SDL_mixer3 girlies (that's the manual section, keep up π
) and it's all about yeeting a track into the void. bye boo π
πΈ NAME πΈ
MIX_DestroyTrack β destroy the specified track. that's it. that's the whole vibe. π
π SYNOPSIS π
#include <SDL3_mixer/SDL_mixer.h>
void MIX_DestroyTrack(MIX_Track *track);
like, one include, one function call. so simple. so iconic. β¨
π DESCRIPTION π
okay so here's the tea, and you need to hear it β
If the track is currently playing, it gets stopped immediately β no fadeout, no gentle exit, no little goodbye wave π it's just gone. Instant. Like your ex's attention span.
And if there's a callback set through MIX_SetTrackStoppedCallback(), it will _not_ be called. Not even a little bit. Not once. Don't @ me. π that's just how it is.
If the mixer is currently mixing in another thread, this will block until it finishes. like it will literally sit there and wait its turn, very demure, very mindful π§
Now this next part is the important one, so listen up π
Destroying a track from the mixer thread itself (during a callback) will cause it to be destroyed as soon as this iteration of the mixer thread is not using it. slay, scheduling! π¦
BUT β in this scenario, destroying a track and then making futher changes to it is considered undefined behavior. π¨ that means all bets are off, the universe stops making sense, no cap. do not touch it after you destroy it. periodt. π
Last thing, and it's a cute one: destroying a NULL MIX_Track is a legal no-op. so if you pass in nothing, it's fine, it just vibes. no crash, no drama, no main character meltdown. π
π FUNCTION PARAMETERS π
trackβ the track to destroy. yeah. the one you're destroying. the one and only. give it here π«Ά
β THREAD SAFETY β
It is safe to call this function from any thread. any of them. all of them. go feral, bestie, the thread police are not coming π₯
π AVAILABILITY π
This function is available since SDL_mixer 3.0.0. so she's been here a minute, she's not new money π
okay that's the whole page!! go forth and destroy tracks responsibly πΈ
shoutout to the SDL_mixer girlies for this one, straight from the manual, version SDL_mixer 3.2.4 β mwah, love you, bye πβ¨π
π¦ where this page comes from
- fedora 44: SDL3_mixer-doc 3.2.4-3.fc44 Β· Zlib AND (GPL-2.0-or-later OR LGPL-2.0-or-later)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms