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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user