GPUOpen-LibrariesAndSDKs / RadeonProRenderBlenderAddon

This hardware-agnostic rendering plug-in for Blender uses accurate ray-tracing technology to produce images and animations of your scenes, and provides real-time interactive rendering and continuous adjustment of effects.
https://gpuopen.com/radeon-prorender-suite/
Apache License 2.0
480 stars 56 forks source link

RPRBLN-2281: Mac Mini M2 crash on addon deactivation #631

Closed VascoPi closed 1 year ago

VascoPi commented 1 year ago

PURPOSE

Mac Mini M2 crash on addon deactivation. https://github.com/GPUOpen-LibrariesAndSDKs/RadeonProRenderBlenderAddon/issues/626

EFFECT OF CHANGE

Fixed addon deactivation crash on Mac Mini M2.

TECHNICAL STEPS

Put apart un/registration for node, socket, and socket interface classes and changed its order.

bsavery commented 1 year ago

It's interesting that this would fix the problem, or rather that the different order only effects one platform.

bsavery commented 1 year ago

@VascoPi can you explain WHY this fixed it? Not clear to me?

VascoPi commented 1 year ago

While debugging it was found that utilizing bpy.utils.register_classes_factory's order for given classes causes the error. Simply changing the unregistering order fixes the issue.

Eventually, I didn't find an accurate explanation for why it happens only at M2. Looks like the blender code doesn't have a special condition for M2 as well.

Also changing Python version to 3.10 while the building process doesn't give any results.

Agree it's strange behavior on M2 because no warnings or errors are observed on other systems using the common bpy.utils.register_classes_factory's order for given classes.