Skip to content
Snippets Groups Projects
Commit d2b1a09d authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Disable the reaper.

We don't appear to need it anymore, and it results in inconsistent
behaviour.
parent bf879f1c
No related branches found
No related tags found
No related merge requests found
...@@ -303,7 +303,6 @@ static int sdl_user_func_ret(int func, ...) ...@@ -303,7 +303,6 @@ static int sdl_user_func_ret(int func, ...)
void exit_sdl_con(void) void exit_sdl_con(void)
{ {
// Avoid calling exit(0) from an atexit() function... // Avoid calling exit(0) from an atexit() function...
ciolib_reaper = 0;
if (!sdl_sync_initialized) if (!sdl_sync_initialized)
sdl_initsync(); sdl_initsync();
sdl_user_func_ret(SDL_USEREVENT_QUIT); sdl_user_func_ret(SDL_USEREVENT_QUIT);
...@@ -429,9 +428,8 @@ int sdl_init(int mode) ...@@ -429,9 +428,8 @@ int sdl_init(int mode)
return(0); return(0);
} }
ciolib_reaper = 0;
sdl_user_func_ret(SDL_USEREVENT_QUIT); sdl_user_func_ret(SDL_USEREVENT_QUIT);
return(-1); exit(0);
} }
static void static void
...@@ -1133,21 +1131,12 @@ void sdl_video_event_thread(void *data) ...@@ -1133,21 +1131,12 @@ void sdl_video_event_thread(void *data)
} }
break; break;
case SDL_QUIT: case SDL_QUIT:
/*
* SDL2: Do we still need the reaper?
* This is what exit()s programs when the
* X is hit.
*/
if (ciolib_reaper)
sdl_user_func(SDL_USEREVENT_QUIT);
else {
if (sdl_init_good) if (sdl_init_good)
sdl_add_key(CIO_KEY_QUIT, &cvstat); sdl_add_key(CIO_KEY_QUIT, &cvstat);
else { else {
sdl.QuitSubSystem(SDL_INIT_VIDEO); sdl.QuitSubSystem(SDL_INIT_VIDEO);
return; return;
} }
}
break; break;
case SDL_WINDOWEVENT: case SDL_WINDOWEVENT:
switch(ev.window.event) { switch(ev.window.event) {
...@@ -1181,8 +1170,6 @@ void sdl_video_event_thread(void *data) ...@@ -1181,8 +1170,6 @@ void sdl_video_event_thread(void *data)
case SDL_USEREVENT_QUIT: case SDL_USEREVENT_QUIT:
sdl_ufunc_retval=0; sdl_ufunc_retval=0;
if (ciolib_reaper)
exit(0);
sdl.QuitSubSystem(SDL_INIT_VIDEO); sdl.QuitSubSystem(SDL_INIT_VIDEO);
sem_post(&sdl_ufunc_ret); sem_post(&sdl_ufunc_ret);
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment