Fix T56610: crash saving images with python API.
This commit is contained in:
parent
a1b38a635e
commit
22dc248f14
Notes:
blender-bot
2023-02-14 19:27:43 +01:00
Referenced by issue #56610, Crash when saving a Blender Image in a Python script Referenced by issue blender/blender-addons#56078, Saving images with python causes Blender to hang
|
@ -147,7 +147,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, &lock);
|
||||
BKE_image_release_ibuf(image, ibuf, lock);
|
||||
WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, image);
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int frame, int f
|
|||
|
||||
if (ibuf == NULL || ibuf->rect == NULL) {
|
||||
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);
|
||||
return (int)GL_INVALID_OPERATION;
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int frame, int f
|
|||
image->bindcode[TEXTARGET_TEXTURE_2D] = 0;
|
||||
}
|
||||
|
||||
BKE_image_release_ibuf(image, ibuf, NULL);
|
||||
BKE_image_release_ibuf(image, ibuf, lock);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue