Correct freeing builtin shader from recent commit

This commit is contained in:
Campbell Barton 2019-01-21 19:05:29 +11:00
parent 7117dfaf67
commit 7bc9a563e6
1 changed files with 3 additions and 1 deletions

View File

@ -864,7 +864,9 @@ static void EDIT_MESH_engine_free(void)
{
for (int sh_data_index = 0; sh_data_index < ARRAY_SIZE(e_data.sh_data); sh_data_index++) {
EDIT_MESH_ShaderData *sh_data = &e_data.sh_data[sh_data_index];
GPUShader **sh_data_as_array = (GPUShader **)&sh_data->weight_face;
/* Don't free builtins. */
sh_data->depth = NULL;
GPUShader **sh_data_as_array = (GPUShader **)sh_data;
for (int i = 0; i < (sizeof(EDIT_MESH_ShaderData) / sizeof(GPUShader *)); i++) {
DRW_SHADER_FREE_SAFE(sh_data_as_array[i]);
}