From 38813bb2a190e870347f43f7ffdaa9d2c8a7045c Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sun, 5 Jul 2015 13:29:35 -0700 Subject: [PATCH] Revert "Avoid segfault in render thread on mobile shutdown codepath" This reverts commit ddefceaf0883e63224aaf1ca4c26bcfc126a38e3. - need an additional boolean instead --- src/video/glvideo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/video/glvideo.c b/src/video/glvideo.c index 070b676c..cae9bb73 100644 --- a/src/video/glvideo.c +++ b/src/video/glvideo.c @@ -628,8 +628,14 @@ static void _gldriver_shutdown(void) { static void gldriver_shutdown(void) { #if USE_GLUT glutLeaveMainLoop(); -#endif +#else +# if MOBILE_DEVICE + // it could be a temporary backgrounding do nothing here ... + _gldriver_shutdown(); +# else emulator_shutting_down = true; +# endif +#endif } //---------------------------------------------------------------------------- @@ -667,13 +673,6 @@ static void gldriver_render(void) { return; } -#if MOBILE_DEVICE - if (UNLIKELY(emulator_shutting_down)) { - _gldriver_shutdown(); - return; - } -#endif - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); #if MOBILE_DEVICE glViewport(viewportX, adjustedHeight, viewportWidth, viewportHeight); @@ -884,6 +883,7 @@ static void gldriver_main_loop(void) { glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); glutMainLoop(); LOG("GLUT main loop finished..."); + emulator_shutting_down = true; _gldriver_shutdown(); #endif // fall through if not GLUT