From: Ryan C. Gordon Date: Fri, 12 Aug 2005 03:24:14 +0000 (+0000) Subject: Hack around crash on shutdown. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=82780a8852d09fa443add4565cebef4f6faefd4a;p=lugaru.git Hack around crash on shutdown. --- diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 6cc47e6..4bf7964 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -89,7 +89,7 @@ extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; -extern FSOUND_STREAM * strm[10]; +extern FSOUND_STREAM * strm[20]; extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); @@ -169,6 +169,9 @@ void Game::Dispose() FSOUND_StopSound(FSOUND_ALL); +// this is causing problems on Linux, but we'll force an _exit() a little +// later in the shutdown process. --ryan. +#if !PLATFORM_LINUX #define streamcount 20 #define samplecount 100 @@ -188,6 +191,7 @@ void Game::Dispose() free(texture.data); } texture.data = 0; +#endif } diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index a12819b..3393eeb 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -203,7 +203,7 @@ extern float accountcampaigntime[10]; extern int accountcampaignchoicesmade[10]; extern int accountcampaignchoices[10][5000]; /********************> Tick() <*****/ -extern FSOUND_STREAM * strm[10]; +extern FSOUND_STREAM * strm[20]; extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 3aecec5..24fcd87 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -1302,6 +1302,10 @@ void CleanUp (void) // the context is destroyed and libGL unloaded by SDL_Quit(). pglDeleteTextures = glDeleteTextures_doNothing; + #if PLATFORM_LINUX + _exit(0); // !!! FIXME: hack...crashes on exit! + #endif + #elif (defined WIN32) if (hRC) { @@ -2366,7 +2370,7 @@ int main(int argc, char **argv) extern int channels[100]; extern FSOUND_SAMPLE * samp[100]; - extern FSOUND_STREAM * strm[10]; + extern FSOUND_STREAM * strm[20]; extern "C" void PlaySoundEx(int chan, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused) { diff --git a/Source/Person.cpp b/Source/Person.cpp index edebfb2..ee9ab1f 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -87,7 +87,7 @@ extern int indialogue; extern bool gamestarted; -extern FSOUND_STREAM * strm[10]; +extern FSOUND_STREAM * strm[20]; extern "C" void PlaySoundEx(int channel, FSOUND_SAMPLE *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused); extern "C" void PlayStreamEx(int chan, FSOUND_STREAM *sptr, FSOUND_DSPUNIT *dsp, signed char startpaused);