diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-22 17:31:33 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-22 17:31:33 +0300 |
commit | 9cfb72ff81a36c26f4b611ec733432968f15a2de (patch) | |
tree | bf7c6af1e2f11bffa681148dd6dff7ca04299b8d /source/blender/blenkernel/intern/image.c | |
parent | 831e86d5391e8665d2fd05c7ff58cf08b8d41a54 (diff) | |
parent | 9f40153094bc72c0c4372893f20f9d2aace17049 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 355aa67a947..711fded8060 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -304,8 +304,11 @@ static void image_free_anims(Image *ima) * Simply free the image data from memory, * on display the image can load again (except for render buffers). */ -void BKE_image_free_buffers(Image *ima) +void BKE_image_free_buffers_ex(Image *ima, bool do_lock) { + if (do_lock) { + BLI_spin_lock(&image_spin); + } image_free_cached_frames(ima); image_free_anims(ima); @@ -324,6 +327,15 @@ void BKE_image_free_buffers(Image *ima) } ima->ok = IMA_OK; + + if (do_lock) { + BLI_spin_unlock(&image_spin); + } +} + +void BKE_image_free_buffers(Image *ima) +{ + BKE_image_free_buffers_ex(ima, false); } /** Free (or release) any data used by this image (does not free the image itself). */ |