mirror of
https://github.com/glest/glest-source.git
synced 2025-08-14 12:23:59 +02:00
- added some device cleanup in case its needed
This commit is contained in:
@@ -377,6 +377,18 @@ bool SoundPlayerOpenAL::init(const SoundPlayerParams* params) {
|
|||||||
this->params = *params;
|
this->params = *params;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
if(context != 0) {
|
||||||
|
alcMakeContextCurrent( NULL );
|
||||||
|
alcDestroyContext(context);
|
||||||
|
context = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(device != 0) {
|
||||||
|
alcCloseDevice(device);
|
||||||
|
device = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Allows platforms to specify which sound device to use
|
// Allows platforms to specify which sound device to use
|
||||||
// using the environment variable: MEGAGLEST_SOUND_DEVICE
|
// using the environment variable: MEGAGLEST_SOUND_DEVICE
|
||||||
char *deviceName = getenv("MEGAGLEST_SOUND_DEVICE");
|
char *deviceName = getenv("MEGAGLEST_SOUND_DEVICE");
|
||||||
|
Reference in New Issue
Block a user