From 82780a8852d09fa443add4565cebef4f6faefd4a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 12 Aug 2005 03:24:14 +0000 Subject: [PATCH] Hack around crash on shutdown. --- Source/GameInitDispose.cpp | 6 +++++- Source/GameTick.cpp | 2 +- Source/OpenGL_Windows.cpp | 6 +++++- Source/Person.cpp | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) 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); -- 2.39.5