From 62b1cdd66e39db58e422e15b20a80d5e05f3dd4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Fri, 26 Aug 2016 14:25:03 +0200 Subject: Fix over creation of cache files handles (leading to memory leaks). Multiple threads could create multiple handles for the same cache file, so protect handle creation with a mutex, to make sure only one is created. --- source/blender/blenloader/intern/readfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7d65dbc2e17..f5bfe1f4de6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2707,6 +2707,7 @@ static void lib_link_cachefiles(FileData *fd, Main *bmain) BLI_listbase_clear(&cache_file->object_paths); cache_file->handle = NULL; + cache_file->handle_mutex = NULL; if (cache_file->adt) { lib_link_animdata(fd, &cache_file->id, cache_file->adt); @@ -2717,6 +2718,7 @@ static void lib_link_cachefiles(FileData *fd, Main *bmain) static void direct_link_cachefile(FileData *fd, CacheFile *cache_file) { cache_file->handle = NULL; + cache_file->handle_mutex = NULL; /* relink animdata */ cache_file->adt = newdataadr(fd, cache_file->adt); -- cgit v1.2.3