From 651c24bbfec735be2491cbc8e7b97f3630ea3850 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 20 Jan 2025 14:01:11 +1100 Subject: [PATCH] See #5799. Fix segfault in upstream Blender when unlinking material objects in specific scenario. I can't explain this one so I'm pretty embarrassed to commit this, but it crashes (see situation in #5799) on my machine and I can't recreate it outside this scenario. In any case I think as a general strategy we should: 1. Minimise reliance on msgbus 2. Msgbus listeners themselves should be wary of invalid state (e.g. if object is now unlinked) 3. Not clear listeners (don't overreach) --- src/bonsai/bonsai/bim/ifc.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/bonsai/bonsai/bim/ifc.py b/src/bonsai/bonsai/bim/ifc.py index 5cf0df62e3..ebf4b2fe09 100644 --- a/src/bonsai/bonsai/bim/ifc.py +++ b/src/bonsai/bonsai/bim/ifc.py @@ -404,9 +404,6 @@ class IfcStore: obj.BIMStyleProperties.ifc_definition_id = 0 else: # bpy.types.Object obj.BIMObjectProperties.ifc_definition_id = 0 - # NOTE: in theory this will also remove listeners added by other addons - # though never had a report when this would be a problem. - bpy.msgbus.clear_by_owner(obj) @staticmethod def execute_ifc_operator(operator: tool.Ifc.Operator, context: bpy.types.Context, is_invoke=False) -> set[str]: