Forgot a conditional check in shader_cg.c before doing freeing of

menu_cg_program - some other cleanups to do with setting stock
shaders in Cg
This commit is contained in:
twinaphex 2013-04-06 16:29:00 +02:00
parent d0505dc7fa
commit 9a4ddfd2e0
3 changed files with 4 additions and 4 deletions

View File

@ -292,7 +292,8 @@ static bool gl_shader_init(void *data)
#ifdef HAVE_CG
case RARCH_SHADER_CG:
backend = &gl_cg_backend;
shader_path = g_settings.video.cg_shader_path;
if (*g_settings.video.cg_shader_path)
shader_path = g_settings.video.cg_shader_path;
break;
#endif

View File

@ -907,7 +907,8 @@ void gl_cg_shader_scale(unsigned index, struct gfx_fbo_scale *scale)
void gl_cg_set_menu_shader(const char *path)
{
free(menu_cg_program);
if (menu_cg_program)
free(menu_cg_program);
menu_cg_program = strdup(path);
}

View File

@ -237,8 +237,6 @@ static bool shader_parse_imports(config_file_t *conf, struct gfx_shader *shader)
return false;
}
enum state_ram_type ram_type = RARCH_STATE_NONE;
if (strcmp(semantic, "capture") == 0)
var->type = RARCH_STATE_CAPTURE;
else if (strcmp(semantic, "transition") == 0)