mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-12-26 00:31:44 +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)
|
||||
{
|
||||
if (!*soundbuf_struct) {
|
||||
// already dealloced
|
||||
return 0;
|
||||
}
|
||||
LOG("OpenALDestroySoundBuffer ...");
|
||||
ALVoice *voice = (*soundbuf_struct)->_this;
|
||||
ALint source = voice->source;
|
||||
|
@ -1275,8 +1275,10 @@ void c_interface_parameters()
|
||||
#ifdef __linux__
|
||||
LOG("Back to Linux, w00t!\n");
|
||||
#endif
|
||||
SpkrDestroy();
|
||||
MB_Destroy();
|
||||
|
||||
video_shutdown();
|
||||
//audio_shutdown(); TODO : fixme ...
|
||||
exit( 0 );
|
||||
}
|
||||
}
|
||||
|
@ -685,13 +685,14 @@ static void gldriver_reshape(int w, int h) {
|
||||
}
|
||||
|
||||
#if USE_GLUT
|
||||
static int glutWindow = -1;
|
||||
static void gldriver_init_glut(GLuint fbo) {
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(/*GLUT_DOUBLE|*/GLUT_RGBA|GLUT_DEPTH);
|
||||
glutInitWindowSize(windowWidth, windowHeight);
|
||||
//glutInitContextVersion(4, 0); -- Is this needed?
|
||||
glutInitContextProfile(GLUT_CORE_PROFILE);
|
||||
glutCreateWindow(PACKAGE_NAME);
|
||||
glutWindow = glutCreateWindow(PACKAGE_NAME);
|
||||
GL_ERRQUIT("GLUT initialization");
|
||||
|
||||
if (glewInit()) {
|
||||
@ -748,6 +749,9 @@ void video_driver_reshape(int w, int h) {
|
||||
}
|
||||
|
||||
void video_driver_shutdown(void) {
|
||||
#if USE_GLUT
|
||||
glutDestroyWindow(glutWindow);
|
||||
#endif
|
||||
gldriver_shutdown();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user