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)
This commit is contained in:
Dion Moult
2025-01-20 14:01:11 +11:00
parent b2213592ea
commit 651c24bbfe
-3
View File
@@ -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]: