From ca40d35086be8e527755e09a1fc88c970e93fb6b Mon Sep 17 00:00:00 2001
From: Germano Cavalcante <germano.costa@ig.com.br>
Date: Thu, 11 Feb 2021 22:53:12 -0300
Subject: [PATCH] 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 "_",".
---
 mesh_snap_utilities_line/widgets.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mesh_snap_utilities_line/widgets.py b/mesh_snap_utilities_line/widgets.py
index 9879bef77..6c011b7a4 100644
--- a/mesh_snap_utilities_line/widgets.py
+++ b/mesh_snap_utilities_line/widgets.py
@@ -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):
-- 
GitLab