0
\$\begingroup\$

Could someone please explain me the differences between the SDL_Mixer functions Mix_Quit and Mix_CloseAudio? I've read the documentation but couldn't really understand it clearly. When to use them and in which row (first Mix_Quit or Mix_CloseAudio?)?

Also, is it ok to use Mix_Quit after using Mix_CloseAudio? The documentation states that you should not call any SDL_Mixer function after Mix_CloseAudio, but it worked when I tested it.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

From the SDL 1.2 documentation (assuming that the functions in the API have not changed meaning):

Mix_Quit cleans up all dynamically loaded library handles, freeing memory.

Mix_CloseAudio shutdown and cleanup the mixer API. After calling this all audio is stopped, the device is closed, and the SDL_mixer functions should not be used.

Each Mix_Init call can load different dynamic library resources since it can have different flags

So, Mix_Quit must be called one time for each Mix_Init call and before Mix_CloseAudio (that must be called only once).

\$\endgroup\$
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .