mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-12-27 06:29:19 +00:00
Prevent some segfaults when shutting down on Linux
This commit is contained in:
parent
5f03582351
commit
031a8f51f8
@ -748,6 +748,10 @@ static long OpenALCreateSoundBuffer(ALBufferParamsStruct *params, ALSoundBufferS
|
|||||||
|
|
||||||
static long OpenALDestroySoundBuffer(ALSoundBufferStruct **soundbuf_struct)
|
static long OpenALDestroySoundBuffer(ALSoundBufferStruct **soundbuf_struct)
|
||||||
{
|
{
|
||||||
|
if (!*soundbuf_struct) {
|
||||||
|
// already dealloced
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
LOG("OpenALDestroySoundBuffer ...");
|
LOG("OpenALDestroySoundBuffer ...");
|
||||||
ALVoice *voice = (*soundbuf_struct)->_this;
|
ALVoice *voice = (*soundbuf_struct)->_this;
|
||||||
ALint source = voice->source;
|
ALint source = voice->source;
|
||||||
|
@ -1275,8 +1275,10 @@ void c_interface_parameters()
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
LOG("Back to Linux, w00t!\n");
|
LOG("Back to Linux, w00t!\n");
|
||||||
#endif
|
#endif
|
||||||
|
SpkrDestroy();
|
||||||
|
MB_Destroy();
|
||||||
|
|
||||||
video_shutdown();
|
video_shutdown();
|
||||||
//audio_shutdown(); TODO : fixme ...
|
|
||||||
exit( 0 );
|
exit( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -685,13 +685,14 @@ static void gldriver_reshape(int w, int h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if USE_GLUT
|
#if USE_GLUT
|
||||||
|
static int glutWindow = -1;
|
||||||
static void gldriver_init_glut(GLuint fbo) {
|
static void gldriver_init_glut(GLuint fbo) {
|
||||||
glutInit(&argc, argv);
|
glutInit(&argc, argv);
|
||||||
glutInitDisplayMode(/*GLUT_DOUBLE|*/GLUT_RGBA|GLUT_DEPTH);
|
glutInitDisplayMode(/*GLUT_DOUBLE|*/GLUT_RGBA|GLUT_DEPTH);
|
||||||
glutInitWindowSize(windowWidth, windowHeight);
|
glutInitWindowSize(windowWidth, windowHeight);
|
||||||
//glutInitContextVersion(4, 0); -- Is this needed?
|
//glutInitContextVersion(4, 0); -- Is this needed?
|
||||||
glutInitContextProfile(GLUT_CORE_PROFILE);
|
glutInitContextProfile(GLUT_CORE_PROFILE);
|
||||||
glutCreateWindow(PACKAGE_NAME);
|
glutWindow = glutCreateWindow(PACKAGE_NAME);
|
||||||
GL_ERRQUIT("GLUT initialization");
|
GL_ERRQUIT("GLUT initialization");
|
||||||
|
|
||||||
if (glewInit()) {
|
if (glewInit()) {
|
||||||
@ -748,6 +749,9 @@ void video_driver_reshape(int w, int h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_shutdown(void) {
|
void video_driver_shutdown(void) {
|
||||||
|
#if USE_GLUT
|
||||||
|
glutDestroyWindow(glutWindow);
|
||||||
|
#endif
|
||||||
gldriver_shutdown();
|
gldriver_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user