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

Call exit() rather than sleep forever in retro_deinit()

This doesn't fix anything since calling exit() from a DLL is
nonsense, but at least it's less wrong than just waiting forever.

Also, when main() returns, tell the frontent to shut down.

It's most likely that this ends up causing the frontend to crash,
but if the stars align, it may exit instead.
parent 526169c8
No related branches found
No related tags found
No related merge requests found
Pipeline #8082 passed
...@@ -184,6 +184,8 @@ runmain(void *arg) ...@@ -184,6 +184,8 @@ runmain(void *arg)
"syncterm" "syncterm"
}; };
main(0, args); main(0, args);
if (env_cb)
env_cb(RETRO_ENVIRONMENT_SHUTDOWN, NULL);
} }
struct rectlist *last_rect = NULL; struct rectlist *last_rect = NULL;
...@@ -215,8 +217,18 @@ retro_deinit(void) ...@@ -215,8 +217,18 @@ retro_deinit(void)
* "The core must release all of its allocated resources before this function returns." * "The core must release all of its allocated resources before this function returns."
* Heh heh heh... sure thing bud. * Heh heh heh... sure thing bud.
*/ */
for (;;) // Just not returning (unsurprisingly) hangs...
SLEEP(1000); //for (;;)
// SLEEP(1000);
// This is bad too, but it's a different bad.
suspendciolib();
env_cb = NULL;
video_cb = NULL;
audio_cb = NULL;
audio_batch_cb = NULL;
input_poll_cb = NULL;
input_state_cb = NULL;
exit(0);
} }
RETRO_API unsigned RETRO_API unsigned
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment