diff options
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_edit.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 261caf57c5d..34207e16f1c 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -40,6 +40,7 @@ #include "BKE_image.h" #include "BKE_main.h" #include "BKE_tessmesh.h" +#include "BKE_library.h" #include "IMB_imbuf_types.h" @@ -78,8 +79,7 @@ void ED_space_image_set(SpaceImage *sima, Scene *scene, Object *obedit, Image *i if (sima->image) BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_USER_NEW_IMAGE); - if (sima->image && ID_REAL_USERS(sima->image) <= 0) - sima->image->id.us = max_ii(sima->image->id.us, 0) + 1; + id_us_ensure_real((ID *)sima->image); if (obedit) WM_main_add_notifier(NC_GEOM | ND_DATA, obedit->data); @@ -97,8 +97,7 @@ void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask) sima->mask_info.mask = mask; /* weak, but same as image/space */ - if (sima->mask_info.mask && ID_REAL_USERS(sima->mask_info.mask) <= 0) - sima->mask_info.mask->id.us = max_ii(sima->mask_info.mask->id.us, 0) + 1; + id_us_ensure_real((ID *)sima->mask_info.mask); if (C) { WM_event_add_notifier(C, NC_MASK | NA_SELECTED, mask); |