diff options
author | Chris Robinson <[email protected]> | 2009-09-15 22:45:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-09-15 22:45:27 -0700 |
commit | 5dff8ea82007650b908d3268850acee3e31d603a (patch) | |
tree | de669dafdcf9ecc7c19b9438508d6bdabbabfaec /Alc/portaudio.c | |
parent | 49648fe22dec8fb5a783d8a7e3929b3231f6f4f4 (diff) |
Properly terminate PortAudio when closing
Diffstat (limited to 'Alc/portaudio.c')
-rw-r--r-- | Alc/portaudio.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c index 347306fe..278434a1 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -35,6 +35,7 @@ static void *pa_handle; #define MAKE_FUNC(x) static typeof(x) * p##x MAKE_FUNC(Pa_Initialize); +MAKE_FUNC(Pa_Terminate); MAKE_FUNC(Pa_GetErrorText); MAKE_FUNC(Pa_StartStream); MAKE_FUNC(Pa_StopStream); @@ -225,6 +226,7 @@ void alc_pa_init(BackendFuncs *func_list) #endif LOAD_FUNC(Pa_Initialize); + LOAD_FUNC(Pa_Terminate); LOAD_FUNC(Pa_GetErrorText); LOAD_FUNC(Pa_StartStream); LOAD_FUNC(Pa_StopStream); @@ -243,11 +245,14 @@ void alc_pa_init(BackendFuncs *func_list) void alc_pa_deinit(void) { -#ifdef HAVE_DLFCN_H if(pa_handle) + { + pPa_Terminate(); +#ifdef HAVE_DLFCN_H dlclose(pa_handle); - pa_handle = NULL; + pa_handle = NULL; #endif + } } void alc_pa_probe(int type) |