diff --git a/gfx/drivers_shader/shader_hlsl.c b/gfx/drivers_shader/shader_hlsl.c index dbcc22cf02..99590a9ccc 100644 --- a/gfx/drivers_shader/shader_hlsl.c +++ b/gfx/drivers_shader/shader_hlsl.c @@ -284,17 +284,19 @@ static void hlsl_deinit_progs(hlsl_shader_data_t *hlsl) { if (hlsl->prg[i].fprg && hlsl->prg[i].fprg != hlsl->prg[0].fprg) hlsl->prg[i].fprg->Release(); - hlsl->prg[i].fprg = NULL; if (hlsl->prg[i].vprg && hlsl->prg[i].vprg != hlsl->prg[0].vprg) hlsl->prg[i].vprg->Release(); + + hlsl->prg[i].fprg = NULL; hlsl->prg[i].vprg = NULL; } if (hlsl->prg[0].fprg) hlsl->prg[0].fprg->Release(); - hlsl->prg[0].fprg = NULL; if (hlsl->prg[0].vprg) hlsl->prg[0].vprg->Release(); + + hlsl->prg[0].fprg = NULL; hlsl->prg[0].vprg = NULL; }