diff options
-rw-r--r-- | source/blender/blenkernel/intern/cachefile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c index 274f7b78529..89c6fad086d 100644 --- a/source/blender/blenkernel/intern/cachefile.c +++ b/source/blender/blenkernel/intern/cachefile.c @@ -93,7 +93,9 @@ void BKE_cachefile_free(CacheFile *cache_file) ABC_free_handle(cache_file->handle); #endif - if (cache_file->handle_mutex) { + /* CoW copies share the mutex, so it should only be freed if the original + * CacheFile datablock is freed. */ + if (cache_file->handle_mutex && (cache_file->id.tag & LIB_TAG_COPIED_ON_WRITE) == 0) { BLI_mutex_free(cache_file->handle_mutex); } BLI_freelistN(&cache_file->object_paths); |