Fix bad handling of 'extra' user for groups at their creation.

Was just keeping the default '1' user from `BKE_libblock_alloc()`,
instead of using correct way to handle extra virtual user needed when we
want to keep unused datablocks around...
This commit is contained in:
Bastien Montagne 2017-05-31 21:24:41 +02:00
parent f783efd127
commit 8b0f968a31
Notes: blender-bot 2023-02-14 11:29:52 +01:00
Referenced by issue #51689, Problems with [Alt]- / [AltGr]- keys in blender 2.78...
1 changed files with 2 additions and 0 deletions

View File

@ -80,6 +80,8 @@ Group *BKE_group_add(Main *bmain, const char *name)
Group *group;
group = BKE_libblock_alloc(bmain, ID_GR, name);
id_us_min(&group->id);
id_us_ensure_real(&group->id);
group->layer = (1 << 20) - 1;
group->preview = NULL;