From e7544e3ce4066cfb1759477a7cc4e405b6969067 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 30 May 2022 16:03:08 +0200 Subject: Fix (unreported) wrong ID usercount handling in background images removal. Assuming that an ID pointer is NULL because another 'source type' property has some specific value is utterly wrong and a gateway to usercounting bugs. --- source/blender/editors/space_view3d/view3d_edit.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 9f8d7afd9a8..922ebe2f0f4 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -631,12 +631,8 @@ static int background_image_remove_exec(bContext *C, wmOperator *op) CameraBGImage *bgpic_rem = BLI_findlink(&cam->bg_images, index); if (bgpic_rem) { - if (bgpic_rem->source == CAM_BGIMG_SOURCE_IMAGE) { - id_us_min((ID *)bgpic_rem->ima); - } - else if (bgpic_rem->source == CAM_BGIMG_SOURCE_MOVIE) { - id_us_min((ID *)bgpic_rem->clip); - } + id_us_min((ID *)bgpic_rem->ima); + id_us_min((ID *)bgpic_rem->clip); BKE_camera_background_image_remove(cam, bgpic_rem); -- cgit v1.2.3