diff options
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index bf27d6021b6..aedbd0673c2 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -4018,12 +4018,12 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock) void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock) { - if (lock) { + if (lock != NULL) { /* for getting image during threaded render / compositing, need to release */ if (lock == ima) { BLI_thread_unlock(LOCK_VIEWER); /* viewer image */ } - else if (lock) { + else { RE_ReleaseResultImage(lock); /* render result */ BLI_thread_unlock(LOCK_VIEWER); /* view image imbuf */ } diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 70b75efdb36..c7a3e103281 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -115,7 +115,9 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports static void rna_Image_save(Image *image, Main *bmain, bContext *C, ReportList *reports) { - ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL); + void *lock; + + ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, &lock); if (ibuf) { char filename[FILE_MAX]; BLI_strncpy(filename, image->name, sizeof(filename)); @@ -142,7 +144,7 @@ static void rna_Image_save(Image *image, Main *bmain, bContext *C, ReportList *r BKE_reportf(reports, RPT_ERROR, "Image '%s' does not have any image data", image->id.name + 2); } - BKE_image_release_ibuf(image, ibuf, NULL); + BKE_image_release_ibuf(image, ibuf, &lock); WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image); } |