GPU Codegen: Fix assert caused by GC of failled shaders.

This commit is contained in:
Clément Foucault 2018-04-09 12:09:51 +02:00
parent 020c4e19f2
commit 3cb42e5917
1 changed files with 3 additions and 1 deletions

View File

@ -2270,7 +2270,9 @@ void GPU_pass_release(GPUPass *pass)
static void gpu_pass_free(GPUPass *pass)
{
BLI_assert(pass->refcount == 0);
GPU_shader_free(pass->shader);
if (pass->shader) {
GPU_shader_free(pass->shader);
}
MEM_SAFE_FREE(pass->fragmentcode);
MEM_SAFE_FREE(pass->geometrycode);
MEM_SAFE_FREE(pass->vertexcode);