Fix odd situation where you could assign a background image without increasing its usercount.

Probably a leftover from old code, I don't think this invoke usage of VIEW3D_OT_background_image_add
was actually reachable anywhere from the UI, but managed to get it working from py, without increasing
user count...
This commit is contained in:
Bastien Montagne 2014-06-30 19:34:52 +02:00
parent 320b7a59c3
commit ed871df836
1 changed files with 1 additions and 2 deletions

View File

@ -4221,8 +4221,7 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, const wmEven
if (ima) {
bgpic->ima = ima;
if (ima->id.us == 0) id_us_plus(&ima->id);
else id_lib_extern(&ima->id);
id_us_plus(&ima->id);
if (!(v3d->flag & V3D_DISPBGPICS))
v3d->flag |= V3D_DISPBGPICS;