diff src/audio/macosx/SDL_coreaudio.c @ 3787:8d74a4721ca9 SDL-ryan-multiple-audio-device

Added deinitialize hook.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 03 Oct 2006 16:26:42 +0000
parents b70f4e9291bb
children 7006b176ef4f
line wrap: on
line diff
--- a/src/audio/macosx/SDL_coreaudio.c	Tue Oct 03 16:02:08 2006 +0000
+++ b/src/audio/macosx/SDL_coreaudio.c	Tue Oct 03 16:26:42 2006 +0000
@@ -179,6 +179,7 @@
 static void COREAUDIO_PlayAudio(_THIS);
 static Uint8 *COREAUDIO_GetAudioBuf(_THIS);
 static void COREAUDIO_CloseAudio(_THIS);
+static void COREAUDIO_Deinitialize(void);
 
 /* Audio driver bootstrap functions */
 
@@ -201,6 +202,7 @@
     impl->PlayAudio = COREAUDIO_PlayAudio;
     impl->GetAudioBuf = COREAUDIO_GetAudioBuf;
     impl->CloseAudio = COREAUDIO_CloseAudio;
+    impl->Deinitialize = COREAUDIO_Deinitialize;
 
     return 1;
 }
@@ -210,6 +212,15 @@
     COREAUDIO_Available, COREAUDIO_Init
 };
 
+
+static void
+COREAUDIO_Deinitialize(void)
+{
+    free_device_list(0, &outputDevices, &outputDeviceCount);
+    free_device_list(1, &inputDevices, &inputDeviceCount);
+}
+
+
 /* The CoreAudio callback */
 static OSStatus
 outputCallback(void *inRefCon,