Make sure to clean up the sound streams as well in function sound_ShutdownLibrary()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5884 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
ceb4e23eda
commit
37c6aa9fd6
|
@ -183,12 +183,11 @@ BOOL sound_InitLibrary( void )
|
|||
return true;
|
||||
}
|
||||
|
||||
//*
|
||||
// =======================================================================================================================
|
||||
// =======================================================================================================================
|
||||
//
|
||||
static void sound_UpdateStreams(void);
|
||||
|
||||
void sound_ShutdownLibrary( void )
|
||||
{
|
||||
AUDIO_STREAM* stream;
|
||||
SAMPLE_LIST * aSample = active_samples, * tmpSample = NULL;
|
||||
|
||||
if ( !openal_initialized )
|
||||
|
@ -197,6 +196,13 @@ void sound_ShutdownLibrary( void )
|
|||
}
|
||||
debug(LOG_SOUND, "starting shutdown");
|
||||
|
||||
// Stop all streams, sound_UpdateStreams() will deallocate all stopped streams
|
||||
for (stream = active_streams; stream != NULL; stream = stream->next)
|
||||
{
|
||||
sound_StopStream(stream);
|
||||
}
|
||||
sound_UpdateStreams();
|
||||
|
||||
#ifndef WZ_NOSOUND
|
||||
/* On Linux since this caused some versions of OpenAL to hang on exit. - Per */
|
||||
debug(LOG_SOUND, "make default context NULL");
|
||||
|
@ -258,8 +264,6 @@ unsigned int sound_GetActiveSamplesCount()
|
|||
return num;
|
||||
}
|
||||
|
||||
static void sound_UpdateStreams(void);
|
||||
|
||||
void sound_Update()
|
||||
{
|
||||
#ifndef WZ_NOSOUND
|
||||
|
|
|
@ -465,7 +465,6 @@ void systemShutdown(void)
|
|||
debug(LOG_MAIN, "shutting down audio subsystems");
|
||||
|
||||
debug(LOG_MAIN, "shutting down CD audio");
|
||||
cdAudio_Stop();
|
||||
cdAudio_Close();
|
||||
|
||||
if ( audio_Disabled() == false && !audio_Shutdown() )
|
||||
|
|
Loading…
Reference in New Issue