diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-06 13:18:41 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-06 17:00:25 +0300 |
commit | f55f418867162994c9a0cf7ba89bed3f27a2a354 (patch) | |
tree | af697bf2a56ec667acf7dc35f8ce2f4e89749286 | |
parent | f884ba02a20a1c6f55e4b0c068ee19d8b5c6f078 (diff) |
Fix incorrect double checked lock in collection object cache.
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index c4709a32f78..4651089a390 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -367,12 +367,12 @@ ListBase BKE_collection_object_cache_get(Collection *collection) if (!(collection->flag & COLLECTION_HAS_OBJECT_CACHE)) { static ThreadMutex cache_lock = BLI_MUTEX_INITIALIZER; + BLI_mutex_lock(&cache_lock); if (!(collection->flag & COLLECTION_HAS_OBJECT_CACHE)) { - BLI_mutex_lock(&cache_lock); collection_object_cache_fill(&collection->object_cache, collection, 0); collection->flag |= COLLECTION_HAS_OBJECT_CACHE; - BLI_mutex_unlock(&cache_lock); } + BLI_mutex_unlock(&cache_lock); } return collection->object_cache; |