[Bf-blender-cvs] [2d32bf14e47] blender-v2.93-release: Fix T89765: boolean modifier collection refcount issue

Philipp Oeser noreply at git.blender.org
Mon Jul 26 08:52:29 CEST 2021


Commit: 2d32bf14e47e830dcb38d98f7d29d803fc31a6c9
Author: Philipp Oeser
Date:   Sat Jul 10 16:15:59 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB2d32bf14e47e830dcb38d98f7d29d803fc31a6c9

Fix T89765: boolean modifier collection refcount issue

The 'collection' property is flagged PROP_ID_REFCOUNT, so the
modifiers foreachIDLink functions should walk with IDWALK_CB_USER
(instead of IDWALK_CB_NOP).

Otherwise the modifier wont be included as a user for the collection
(e.g. on file read); removing the collection from the modifier will
decrement usercount though (which in worst case scenario makes the
collection orphan and will result in data loss)

Maniphest Tasks: T89765

Differential Revision: https://developer.blender.org/D11877

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

M	source/blender/modifiers/intern/MOD_boolean.cc

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

diff --git a/source/blender/modifiers/intern/MOD_boolean.cc b/source/blender/modifiers/intern/MOD_boolean.cc
index 40d5386c2fa..f1985cf7bd1 100644
--- a/source/blender/modifiers/intern/MOD_boolean.cc
+++ b/source/blender/modifiers/intern/MOD_boolean.cc
@@ -109,7 +109,7 @@ static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *u
 {
   BooleanModifierData *bmd = (BooleanModifierData *)md;
 
-  walk(userData, ob, (ID **)&bmd->collection, IDWALK_CB_NOP);
+  walk(userData, ob, (ID **)&bmd->collection, IDWALK_CB_USER);
   walk(userData, ob, (ID **)&bmd->object, IDWALK_CB_NOP);
 }



More information about the Bf-blender-cvs mailing list