Cleanup: make Group Unlink operator use BKE_libblock_delete(), since that's what...
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 15 Jun 2017 10:49:40 +0000 (12:49 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 15 Jun 2017 10:49:40 +0000 (12:49 +0200)
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.

source/blender/editors/object/object_group.c

index 0fe43c44d7d7aadf8d7ece035679ddaf5dd6c6fe..568778c0a863b15cdf697f6ab0c1bb4716386986 100644 (file)
@@ -528,8 +528,7 @@ static int group_unlink_exec(bContext *C, wmOperator *UNUSED(op))
        if (!group)
                return OPERATOR_CANCELLED;
 
        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);
 
 
        WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL);