Merge pull request #7952 from orbea/dummy

Fix crashes with '--disable-menu' and the Qt frontend.
This commit is contained in:
Twinaphex 2019-01-09 19:29:03 +01:00 committed by GitHub
commit 60a2d5c87c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 5 deletions

View File

@ -82,10 +82,13 @@ bool content_reset_savestate_backups(void);
bool content_undo_load_buf_is_empty(void);
bool content_undo_save_buf_is_empty(void);
/* Clears the pending subsystem rom buffer*/
/* Checks if launched from the commandline */
bool content_launched_from_cli(void);
/* Clears the pending subsystem rom buffer */
bool content_is_subsystem_pending_load(void);
/* Clears the pending subsystem rom buffer*/
/* Clears the pending subsystem rom buffer */
void content_clear_subsystem(void);
/* Set the current subsystem*/

View File

@ -1406,9 +1406,12 @@ bool retroarch_main_init(int argc, char *argv[])
/* Handle core initialization failure */
if (init_failed)
{
#ifdef HAVE_MENU
/* Check if menu was active prior to core initialization */
if (menu_driver_is_alive())
if (!content_launched_from_cli()
#ifdef HAVE_MENU
|| menu_driver_is_alive()
#endif
)
{
/* Attempt initializing dummy core */
current_core_type = CORE_TYPE_DUMMY;
@ -1416,7 +1419,6 @@ bool retroarch_main_init(int argc, char *argv[])
goto error;
}
else
#endif
{
/* Fall back to regular error handling */
goto error;

View File

@ -138,6 +138,7 @@ struct content_information_ctx
};
static struct string_list *temporary_content = NULL;
static bool _launched_from_cli = true;
static bool _content_is_inited = false;
static bool core_does_not_need_content = false;
static uint32_t content_rom_crc = 0;
@ -1603,6 +1604,8 @@ bool task_push_load_content_with_new_core_from_companion_ui(
command_event(CMD_EVENT_LOAD_CORE, NULL);
#endif
_launched_from_cli = false;
/* Load content */
if (!task_load_content_callback(content_info, true, false))
return false;
@ -1758,6 +1761,12 @@ void content_clear_subsystem(void)
}
}
/* Checks if launched from the commandline */
bool content_launched_from_cli()
{
return _launched_from_cli;
}
/* Get the current subsystem */
int content_get_subsystem()
{