Pass state around to menu_shader_manager_free

This commit is contained in:
twinaphex 2020-06-06 18:44:53 +02:00
parent 35fce65656
commit 82c009d405
3 changed files with 5 additions and 5 deletions

View File

@ -57,9 +57,9 @@ struct video_shader *menu_shader_get(void)
return NULL;
}
void menu_shader_manager_free(void)
void menu_shader_manager_free(void *data)
{
menu_handle_t *menu = menu_driver_get_ptr();
menu_handle_t *menu = (menu_handle_t*)data;
if (menu->menu_driver_shader)
free(menu->menu_driver_shader);
menu->menu_driver_shader = NULL;
@ -92,7 +92,7 @@ bool menu_shader_manager_init(void)
else
path_shader = retroarch_get_shader_preset();
menu_shader_manager_free();
menu_shader_manager_free(menu);
menu_shader = (struct video_shader*)
calloc(1, sizeof(*menu_shader));

View File

@ -33,7 +33,7 @@ enum auto_shader_type
struct video_shader *menu_shader_get(void);
void menu_shader_manager_free(void);
void menu_shader_manager_free(void *data);
/**
* menu_shader_manager_init:

View File

@ -5929,7 +5929,7 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
playlist_free_cached();
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
menu_shader_manager_free();
menu_shader_manager_free(p_rarch->menu_driver_data);
#endif
#ifdef HAVE_NETWORKING
core_updater_list_free_cached();