Fix T66005: crash deleting render slot while rendering to it

This commit is contained in:
Brecht Van Lommel 2020-05-14 02:38:02 +02:00
parent e2eb47191d
commit 88841559de
Notes: blender-bot 2024-01-16 18:05:25 +01:00
Referenced by issue #66005, Crash - delete render slot while rendering
1 changed files with 7 additions and 0 deletions

View File

@ -5726,6 +5726,13 @@ RenderSlot *BKE_image_add_renderslot(Image *ima, const char *name)
bool BKE_image_remove_renderslot(Image *ima, ImageUser *iuser, int index)
{
if (index == ima->last_render_slot) {
/* Don't remove render slot while rendering to it. */
if (G.is_rendering) {
return false;
}
}
int num_slots = BLI_listbase_count(&ima->renderslots);
if (index >= num_slots || num_slots == 1) {
return false;