1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

fix core unload when closing content

This commit is contained in:
Brad Parker 2016-09-05 12:46:28 -04:00
parent 86d2a36407
commit abd5d81b70
2 changed files with 19 additions and 15 deletions

View File

@ -1778,8 +1778,10 @@ static void command_event_main_state(unsigned cmd)
void handle_quit_event()
{
settings_t *settings = config_get_ptr();
#ifdef HAVE_MENU
if (menu_popup_is_active())
if (settings && settings->confirm_on_exit &&
menu_popup_is_active())
return;
#endif
@ -1980,19 +1982,21 @@ bool command_event(enum event_command cmd, void *data)
command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL);
command_event(CMD_EVENT_RESTORE_DEFAULT_SHADER_PRESET, NULL);
if (content_is_inited())
if (!task_push_content_load_default(
NULL, NULL,
&content_info,
CORE_TYPE_DUMMY,
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
NULL, NULL))
return false;
if (content_is_inited())
if (!task_push_content_load_default(
NULL, NULL,
&content_info,
CORE_TYPE_DUMMY,
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
NULL, NULL))
return false;
#ifndef HAVE_DYNAMIC
core_unload_game();
core_unload();
core_unload_game();
core_unload();
#else
command_event(CMD_EVENT_LOAD_CORE_DEINIT, NULL);
#endif
break;
break;
case CMD_EVENT_QUIT_CONFIRM:
handle_quit_event();
break;

View File

@ -1355,12 +1355,12 @@ static INLINE int runloop_iterate_time_to_exit(bool quit_key_pressed)
return 1;
#ifdef HAVE_MENU
if (!runloop_quit_confirm && menu_popup_is_active())
return 1;
if (settings && settings->confirm_on_exit &&
!runloop_quit_confirm)
{
if (menu_popup_is_active())
return 1;
if (content_is_inited())
{
if(menu_display_toggle_get_reason() != MENU_TOGGLE_REASON_USER)