Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-11-12 20:06:32 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-12 20:07:01 +0300
commitd941f40c21f9b7eae861914db5b24427413044c9 (patch)
tree416052d8e52b2a2505075130501da0e14631bcd6 /source/blender/draw/intern
parent7f2401532e8ce30e5142ac9236bc32db988f9a6e (diff)
Fix T57571: Blender crashes on UV transformation
That was caused by a thread safety issue on gpu_batch_presets_unregister() which was not designed to be used for this kind of situation (managing 3D meshes batches).
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 63c93e95754..8cd2da1a898 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -2195,12 +2195,24 @@ static void mesh_batch_cache_discard_uvedit(MeshBatchCache *cache)
GPU_INDEXBUF_DISCARD_SAFE(cache->edituv_visible_faces);
GPU_INDEXBUF_DISCARD_SAFE(cache->edituv_visible_edges);
- gpu_batch_presets_unregister(cache->edituv_faces_strech_area);
- gpu_batch_presets_unregister(cache->edituv_faces_strech_angle);
- gpu_batch_presets_unregister(cache->edituv_faces);
- gpu_batch_presets_unregister(cache->edituv_edges);
- gpu_batch_presets_unregister(cache->edituv_verts);
- gpu_batch_presets_unregister(cache->edituv_facedots);
+ if (cache->edituv_faces_strech_area) {
+ gpu_batch_presets_unregister(cache->edituv_faces_strech_area);
+ }
+ if (cache->edituv_faces_strech_angle) {
+ gpu_batch_presets_unregister(cache->edituv_faces_strech_angle);
+ }
+ if (cache->edituv_faces) {
+ gpu_batch_presets_unregister(cache->edituv_faces);
+ }
+ if (cache->edituv_edges) {
+ gpu_batch_presets_unregister(cache->edituv_edges);
+ }
+ if (cache->edituv_verts) {
+ gpu_batch_presets_unregister(cache->edituv_verts);
+ }
+ if (cache->edituv_facedots) {
+ gpu_batch_presets_unregister(cache->edituv_facedots);
+ }
GPU_BATCH_DISCARD_SAFE(cache->edituv_faces_strech_area);
GPU_BATCH_DISCARD_SAFE(cache->edituv_faces_strech_angle);