Fix mesh_snap_utilities_line crash when closing blender

When the tool is active and the blender is closed, the `GizmoGroup` type
object is freed keeping some invalid RNA members.

This is probably an internal error, but for now just work around this
error by starting the object name with '_' since "RNA can't start with
a "_",".
This commit is contained in:
Germano Cavalcante 2021-02-11 22:53:12 -03:00
parent 393c978bad
commit ca40d35086
1 changed files with 3 additions and 3 deletions

View File

@ -164,11 +164,11 @@ class SnapWidgetGroupCommon(bpy.types.GizmoGroup):
return context_mode_check(context, cls.bl_idname)
def init_tool(self, context, gizmo_name):
self.widget = self.gizmos.new(gizmo_name)
self._widget = self.gizmos.new(gizmo_name)
def __del__(self):
if hasattr(self, "widget"):
object.__getattribute__(self.widget, 'end_snapwidget')()
if hasattr(self, "_widget"):
object.__getattribute__(self._widget, 'end_snapwidget')()
class SnapPointWidgetGroup(SnapWidgetGroupCommon):