Fix T51657: ID user count error when deleting a newly created object with an assigned dupli_group

Stupid RNA accessor was not handling usercount at all on Object.dupli_group...
This commit is contained in:
Bastien Montagne 2017-05-29 17:44:39 +02:00
parent 06ca2c9d03
commit f212bfa3cd
Notes: blender-bot 2023-02-14 09:38:57 +01:00
Referenced by issue #51657, ID user count error when deleting a newly created object with an assigned dupli_group
1 changed files with 2 additions and 1 deletions

View File

@ -528,8 +528,9 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value)
* thus causing a cycle/infinite-recursion leading to crashes on load [#25298]
*/
if (BKE_group_object_exists(grp, ob) == 0) {
id_us_min(&ob->dup_group->id);
ob->dup_group = grp;
id_lib_extern((ID *)grp);
id_us_plus(&ob->dup_group->id);
}
else {
BKE_report(NULL, RPT_ERROR,