Move history_free and history_init to higher-level menu_common.c

This commit is contained in:
twinaphex 2013-04-28 03:48:35 +02:00
parent d70a7df8ae
commit 8768a69bc6
2 changed files with 10 additions and 9 deletions

View File

@ -416,6 +416,14 @@ void menu_init(void)
#ifdef HAVE_SHADER_MANAGER
shader_manager_init(rgui);
#endif
// TODO: Should make history path configurable.
// Possibly size as well.
char history_path[PATH_MAX];
fill_pathname_resolve_relative(history_path, g_extern.config_path,
".retroarch-history.txt", sizeof(history_path));
RARCH_LOG("[RGUI]: Opening history: %s.\n", history_path);
rgui->history = rom_history_init(history_path, 20);
}
void menu_free(void)
@ -426,6 +434,8 @@ void menu_free(void)
filebrowser_free(rgui->browser);
#endif
rom_history_free(rgui->history);
free(rgui);
}

View File

@ -225,14 +225,6 @@ rgui_handle_t *rgui_init(void)
(float)custom->width / custom->height;
}
// TODO: Should make history path configurable.
// Possibly size as well.
char history_path[PATH_MAX];
fill_pathname_resolve_relative(history_path, g_extern.config_path,
".retroarch-history.txt", sizeof(history_path));
RARCH_LOG("[RGUI]: Opening history: %s.\n", history_path);
rgui->history = rom_history_init(history_path, 20);
return rgui;
}
@ -245,7 +237,6 @@ void rgui_free(rgui_handle_t *rgui)
libretro_free_system_info(&rgui->info);
#endif
rom_history_free(rgui->history);
rgui_list_free(rgui->menu_stack);
rgui_list_free(rgui->selection_buf);
}