aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c31
-rw-r--r--Alc/alsa.c4
-rw-r--r--Alc/dsound.c4
-rw-r--r--Alc/oss.c4
-rw-r--r--Alc/portaudio.c4
-rw-r--r--Alc/pulseaudio.c4
-rw-r--r--Alc/solaris.c4
-rw-r--r--Alc/wave.c4
-rw-r--r--Alc/winmm.c4
-rw-r--r--OpenAL32/Include/alMain.h8
10 files changed, 62 insertions, 9 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index aa4775de..a47a03d2 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -43,33 +43,34 @@
static struct {
const char *name;
void (*Init)(BackendFuncs*);
+ void (*Deinit)(void);
BackendFuncs Funcs;
} BackendList[] = {
#ifdef HAVE_ALSA
- { "alsa", alc_alsa_init, EmptyFuncs },
+ { "alsa", alc_alsa_init, alc_alsa_deinit, EmptyFuncs },
#endif
#ifdef HAVE_OSS
- { "oss", alc_oss_init, EmptyFuncs },
+ { "oss", alc_oss_init, alc_oss_deinit, EmptyFuncs },
#endif
#ifdef HAVE_SOLARIS
- { "solaris", alc_solaris_init, EmptyFuncs },
+ { "solaris", alc_solaris_init, alc_solaris_deinit, EmptyFuncs },
#endif
#ifdef HAVE_DSOUND
- { "dsound", alcDSoundInit, EmptyFuncs },
+ { "dsound", alcDSoundInit, alcDSoundDeinit, EmptyFuncs },
#endif
#ifdef HAVE_WINMM
- { "winmm", alcWinMMInit, EmptyFuncs },
+ { "winmm", alcWinMMInit, alcWinMMDeinit, EmptyFuncs },
#endif
#ifdef HAVE_PORTAUDIO
- { "port", alc_pa_init, EmptyFuncs },
+ { "port", alc_pa_init, alc_pa_deinit, EmptyFuncs },
#endif
#ifdef HAVE_PULSEAUDIO
- { "pulse", alc_pulse_init, EmptyFuncs },
+ { "pulse", alc_pulse_init, alc_pulse_deinit, EmptyFuncs },
#endif
- { "wave", alc_wave_init, EmptyFuncs },
+ { "wave", alc_wave_init, alc_wave_deinit, EmptyFuncs },
- { NULL, NULL, EmptyFuncs }
+ { NULL, NULL, NULL, EmptyFuncs }
};
#undef EmptyFuncs
@@ -204,6 +205,8 @@ static ALboolean init_done = AL_FALSE;
#ifdef _WIN32
BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
+ int i;
+
(void)lpReserved;
// Perform actions based on the reason for calling.
@@ -217,6 +220,10 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
if(!init_done)
break;
ReleaseALC();
+
+ for(i = 0;BackendList[i].Deinit;i++)
+ BackendList[i].Deinit();
+
FreeALConfig();
ALTHUNK_EXIT();
DeleteCriticalSection(&g_csMutex);
@@ -230,10 +237,16 @@ static void my_deinit() __attribute__((destructor));
static void my_deinit()
{
static ALenum once = AL_FALSE;
+ int i;
+
if(once || !init_done) return;
once = AL_TRUE;
ReleaseALC();
+
+ for(i = 0;BackendList[i].Deinit;i++)
+ BackendList[i].Deinit();
+
FreeALConfig();
ALTHUNK_EXIT();
DeleteCriticalSection(&g_csMutex);
diff --git a/Alc/alsa.c b/Alc/alsa.c
index 6fe1b1f7..35f7ae8a 100644
--- a/Alc/alsa.c
+++ b/Alc/alsa.c
@@ -996,3 +996,7 @@ next_card:
psnd_pcm_info_free(pcminfo);
psnd_ctl_card_info_free(info);
}
+
+void alc_alsa_deinit(void)
+{
+}
diff --git a/Alc/dsound.c b/Alc/dsound.c
index ce628665..d50ecadb 100644
--- a/Alc/dsound.c
+++ b/Alc/dsound.c
@@ -505,3 +505,7 @@ LOAD_FUNC(DirectSoundEnumerateA);
if(FAILED(hr))
AL_PRINT("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr);
}
+
+void alcDSoundDeinit(void)
+{
+}
diff --git a/Alc/oss.c b/Alc/oss.c
index 76455f58..aaa2e47a 100644
--- a/Alc/oss.c
+++ b/Alc/oss.c
@@ -479,3 +479,7 @@ void alc_oss_init(BackendFuncs *func_list)
oss_device_capture = AppendCaptureDeviceList("OSS Capture");
}
+
+void alc_oss_deinit(void)
+{
+}
diff --git a/Alc/portaudio.c b/Alc/portaudio.c
index 4d3eb1de..01e82e73 100644
--- a/Alc/portaudio.c
+++ b/Alc/portaudio.c
@@ -251,3 +251,7 @@ void alc_pa_init(BackendFuncs *func_list)
pa_device = AppendDeviceList("PortAudio Software");
AppendAllDeviceList(pa_device);
}
+
+void alc_pa_deinit(void)
+{
+}
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c
index afb3ee6d..dd3621c1 100644
--- a/Alc/pulseaudio.c
+++ b/Alc/pulseaudio.c
@@ -701,4 +701,8 @@ LOAD_FUNC(pa_threaded_mainloop_lock);
pulse_capture_device = AppendCaptureDeviceList("PulseAudio Capture");
} //}}}
+
+void alc_pulse_deinit(void) //{{{
+{
+} //}}}
//}}}
diff --git a/Alc/solaris.c b/Alc/solaris.c
index 267a27a0..5f0ebf17 100644
--- a/Alc/solaris.c
+++ b/Alc/solaris.c
@@ -282,3 +282,7 @@ void alc_solaris_init(BackendFuncs *func_list)
solaris_device = AppendDeviceList("Solaris Software");
AppendAllDeviceList(solaris_device);
}
+
+void alc_solaris_deinit(void)
+{
+}
diff --git a/Alc/wave.c b/Alc/wave.c
index 2867a906..da98113e 100644
--- a/Alc/wave.c
+++ b/Alc/wave.c
@@ -370,3 +370,7 @@ void alc_wave_init(BackendFuncs *func_list)
waveDevice = AppendDeviceList("Wave File Writer");
AppendAllDeviceList(waveDevice);
}
+
+void alc_wave_deinit(void)
+{
+}
diff --git a/Alc/winmm.c b/Alc/winmm.c
index 5365cbc7..9b16b9eb 100644
--- a/Alc/winmm.c
+++ b/Alc/winmm.c
@@ -440,3 +440,7 @@ void alcWinMMInit(BackendFuncs *FuncList)
}
}
}
+
+void alcWinMMDeinit()
+{
+}
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index ca9d8006..9eb32e59 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -160,13 +160,21 @@ typedef struct {
} BackendFuncs;
void alc_alsa_init(BackendFuncs *func_list);
+void alc_alsa_deinit(void);
void alc_oss_init(BackendFuncs *func_list);
+void alc_oss_deinit(void);
void alc_solaris_init(BackendFuncs *func_list);
+void alc_solaris_deinit(void);
void alcDSoundInit(BackendFuncs *func_list);
+void alcDSoundDeinit(void);
void alcWinMMInit(BackendFuncs *FuncList);
+void alcWinMMDeinit(void);
void alc_pa_init(BackendFuncs *func_list);
+void alc_pa_deinit(void);
void alc_wave_init(BackendFuncs *func_list);
+void alc_wave_deinit(void);
void alc_pulse_init(BackendFuncs *func_list);
+void alc_pulse_deinit(void);
struct ALCdevice_struct