diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-20 18:56:01 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-20 18:57:05 +0300 |
commit | 5a957c0299539f571029d7d96ff77367a596eff2 (patch) | |
tree | 68953b0db0e2a7e233d41603b9b14908012e89a3 /source/blender/gpu/opengl/gl_batch.cc | |
parent | 89ee260ef22e27c9064dad54331c4c595f23b7e5 (diff) |
GPUShaderInterface: Fix use after free crash
Diffstat (limited to 'source/blender/gpu/opengl/gl_batch.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_batch.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc index 8dd4c6c21c0..9ca0a9f71db 100644 --- a/source/blender/gpu/opengl/gl_batch.cc +++ b/source/blender/gpu/opengl/gl_batch.cc @@ -171,10 +171,9 @@ void GLVaoCache::clear(void) } for (int i = 0; i < count; i++) { - if (interfaces[i] == NULL) { - continue; + if (interfaces[i] != NULL) { + const_cast<GLShaderInterface *>(interfaces[i])->ref_remove(this); } - const_cast<GLShaderInterface *>(interfaces[i])->ref_add(this); } if (is_dynamic_vao_count) { |