diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-08-26 15:25:03 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-08-26 15:28:50 +0300 |
commit | 62b1cdd66e39db58e422e15b20a80d5e05f3dd4f (patch) | |
tree | c80b6eefbc2d638d2b049acbe3e60cbbf3c3f67a /source/blender/blenloader/intern | |
parent | 8870c454a1aa9cd8a0547d533fc0d7fc2a048ca0 (diff) |
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.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |