diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-28 10:39:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-28 10:48:57 +0300 |
commit | 3944560b4a3a8c08a51c955977e3be3ae07a1afa (patch) | |
tree | 0331dc9a1bf16f1c3ff34428943f6caf4934c916 /source/blender/blenkernel/intern/brush.c | |
parent | 0a6bca1f75398aa9acbeae8bd596550cd2ee23e6 (diff) |
Cleanup: re-order expensive checks for indirect ID use
Check for indirect ID use after other simple user count checks are made.
Also assert ED_object_base_free_and_unlink_no_indirect_check object
argument isn't indirectly used.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 13ba1957a32..ef567044282 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -574,8 +574,8 @@ bool BKE_brush_delete(Main *bmain, Brush *brush) if (brush->id.tag & LIB_TAG_INDIRECT) { return false; } - if (BKE_library_ID_is_indirectly_used(bmain, brush) && ID_REAL_USERS(brush) <= 1 && - ID_EXTRA_USERS(brush) == 0) { + if (ID_REAL_USERS(brush) <= 1 && ID_EXTRA_USERS(brush) == 0 && + BKE_library_ID_is_indirectly_used(bmain, brush)) { return false; } |