frontend.c - cleanups

This commit is contained in:
twinaphex 2013-07-27 17:30:05 +02:00
parent ad7884e441
commit 484c5b8341
1 changed files with 7 additions and 13 deletions

View File

@ -145,16 +145,6 @@ static void rarch_get_environment(int argc, char *argv[])
#endif
}
static void system_shutdown(void)
{
if (frontend_ctx && frontend_ctx->shutdown)
frontend_ctx->shutdown(true);
#if defined(__APPLE__)
dispatch_async_f(dispatch_get_main_queue(), 0, apple_rarch_exited);
#endif
}
#if defined(__APPLE__)
static pthread_mutex_t apple_event_queue_lock = PTHREAD_MUTEX_INITIALIZER;
@ -211,8 +201,7 @@ void* rarch_main(void* args)
int rarch_main(int argc, char *argv[])
#endif
{
if ((frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first()) == NULL)
RARCH_WARN("Could not find valid frontend context.\n");
frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first();
if (frontend_ctx && frontend_ctx->init)
frontend_ctx->init();
@ -392,7 +381,12 @@ int rarch_main(int argc, char *argv[])
rarch_main_clear_state();
system_shutdown();
if (frontend_ctx && frontend_ctx->shutdown)
frontend_ctx->shutdown(true);
#if defined(__APPLE__)
dispatch_async_f(dispatch_get_main_queue(), 0, apple_rarch_exited);
#endif
return 0;
}