[Bf-blender-cvs] [2bd51474a44] master: Cleanup: make Group Unlink operator use BKE_libblock_delete(), since that's what it is doing.

Bastien Montagne noreply at git.blender.org
Thu Jun 15 15:49:19 CEST 2017


Commit: 2bd51474a440aaa2f3a7a90b2e3da663f2fc1f42
Author: Bastien Montagne
Date:   Thu Jun 15 12:49:40 2017 +0200
Branches: master
https://developer.blender.org/rB2bd51474a440aaa2f3a7a90b2e3da663f2fc1f42

Cleanup: make Group Unlink operator use BKE_libblock_delete(), since that's what it is doing.

Previous code (same as what `BKE_libblock_free_us()` is doing when
usercount reach 0) was probably OK in that specific case, but still not
good idea, and potentially risky.

===================================================================

M	source/blender/editors/object/object_group.c

===================================================================

diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 0fe43c44d7d..568778c0a86 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -528,8 +528,7 @@ static int group_unlink_exec(bContext *C, wmOperator *UNUSED(op))
 	if (!group)
 		return OPERATOR_CANCELLED;
 
-	BKE_libblock_unlink(bmain, group, false, false);
-	BKE_libblock_free(bmain, group);
+	BKE_libblock_delete(bmain, group);
 
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL);




More information about the Bf-blender-cvs mailing list