Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
audio: Clean up some CloseDevice() interface details.
- It's now always called if device->hidden isn't NULL, even if OpenDevice() failed halfway through. This lets implementation code not have to clean up itself on every possible failure point; just return an error and SDL will handle it for you. - Implementations can assume this->hidden != NULL and not check for it. - implementations don't have to set this->hidden = NULL when done, because the caller is always about to free(this). - Don't reset other fields that are in a block of memory about to be free()'d. - Implementations all now free things like internal mix buffers last, after closing devices and such, to guarantee they definitely aren't in use anymore at the point of deallocation.
- Loading branch information
Showing
with
168 additions
and 370 deletions.
- +5 −3 src/audio/SDL_audio.c
- +0 −1 src/audio/SDL_sysaudio.h
- +5 −22 src/audio/alsa/SDL_alsa_audio.c
- +2 −4 src/audio/android/SDL_androidaudio.c
- +5 −15 src/audio/arts/SDL_artsaudio.c
- +4 −12 src/audio/bsd/SDL_bsdaudio.c
- +32 −43 src/audio/coreaudio/SDL_coreaudio.c
- +6 −15 src/audio/directsound/SDL_directsound.c
- +4 −11 src/audio/disk/SDL_diskaudio.c
- +4 −18 src/audio/dsp/SDL_dspaudio.c
- +2 −10 src/audio/emscripten/SDL_emscriptenaudio.c
- +4 −13 src/audio/esd/SDL_esdaudio.c
- +9 −17 src/audio/fusionsound/SDL_fsaudio.c
- +4 −11 src/audio/haiku/SDL_haikuaudio.cc
- +0 −2 src/audio/nacl/SDL_naclaudio.c
- +4 −13 src/audio/nas/SDL_nasaudio.c
- +4 −15 src/audio/paudio/SDL_paudio.c
- +3 −7 src/audio/psp/SDL_pspaudio.c
- +8 −18 src/audio/pulseaudio/SDL_pulseaudio.c
- +13 −27 src/audio/qsa/SDL_qsa_audio.c
- +4 −14 src/audio/sndio/SDL_sndioaudio.c
- +5 −11 src/audio/sun/SDL_sunaudio.c
- +19 −36 src/audio/winmm/SDL_winmm.c
- +22 −32 src/audio/xaudio2/SDL_xaudio2.c
Oops, something went wrong.