Merge pull request #2357 from leiradel/master

fix crashes for cores that don't require content to run
This commit is contained in:
Twinaphex 2015-11-06 22:32:24 +01:00
commit 656903df9e
2 changed files with 11 additions and 6 deletions

View File

@ -1784,6 +1784,10 @@ int cheevos_load(const struct retro_game_info *info)
if (!config_get_ptr()->cheevos.enable)
return 0;
/* Also return OK if there's no content. */
if (!info)
return 0;
memory = core.retro_get_memory_size(RETRO_MEMORY_SYSTEM_RAM);
memory += core.retro_get_memory_size(RETRO_MEMORY_VIDEO_RAM);
memory += core.retro_get_memory_size(RETRO_MEMORY_RTC);
@ -1792,7 +1796,8 @@ int cheevos_load(const struct retro_game_info *info)
if (!memory)
{
rarch_main_msg_queue_push("This core doesn't support achievements", 0, 5 * 60, false);
//return -1;
RARCH_LOG("This core doesn't support achievements\n");
return -1;
}
/* The the supported extensions as a hint to what method we should use. */

View File

@ -517,12 +517,12 @@ static bool load_content(const struct retro_subsystem_info *special,
{
ret = core.retro_load_game(*content->elems[0].data ? info : NULL);
#ifdef HAVE_CHEEVOS
/* Load the achievements into memory if the game has content. */
#ifdef HAVE_CHEEVOS
/* Load the achievements into memory if the game has content. */
cheevos_globals.cheats_were_enabled = cheevos_globals.cheats_are_enabled;
cheevos_load(*content->elems[0].data ? info : NULL);
#endif
cheevos_globals.cheats_were_enabled = cheevos_globals.cheats_are_enabled;
cheevos_load(*content->elems[0].data ? info : NULL);
#endif
}
if (!ret)