Fix Scene datablocks being created with a real user while never having any real datablock user.

Now using new system dedicated to that kind of cases, id_ensure_real_user(), instead.
That way, usercount of Scenes is handled correctly at deletion time.

Reported by @sergey over IRC, thanks.
This commit is contained in:
Bastien Montagne 2016-09-26 16:35:52 +02:00
parent eab3e0af1c
commit b23ffded08
1 changed files with 2 additions and 0 deletions

View File

@ -819,6 +819,8 @@ Scene *BKE_scene_add(Main *bmain, const char *name)
Scene *sce;
sce = BKE_libblock_alloc(bmain, ID_SCE, name);
id_us_min(&sce->id);
id_us_ensure_real(&sce->id);
BKE_scene_init(sce);