Merge branch 'master' into blender2.8

This commit is contained in:
Bastien Montagne 2018-07-11 14:56:13 +02:00
commit 42fa889e46
2 changed files with 6 additions and 4 deletions

View File

@ -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 */
}

View File

@ -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);
}