Revert "Avoid segfault in render thread on mobile shutdown codepath"

This reverts commit ddefceaf08.

    - need an additional boolean instead
This commit is contained in:
Aaron Culliney 2015-07-05 13:29:35 -07:00
parent 4305909d67
commit 38813bb2a1

View File

@ -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