Skip to content

Commit

Permalink
Merge pull request #4957 from nortikin/fix_4956_some_errors_in_consol…
Browse files Browse the repository at this point in the history
…e_on_close_Blender

fix #4956 Some errors in console on close Blender (std.err)
  • Loading branch information
satabol authored Jul 21, 2023
2 parents a6dfaf7 + 2509aa6 commit 44e611d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nodes/viz/geo_nodes_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,5 +290,5 @@ def register():


def unregister():
for cls in classes:
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
2 changes: 1 addition & 1 deletion ui/nodes_replacement.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,5 @@ def register():


def unregister():
for cls in classes:
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
6 changes: 4 additions & 2 deletions ui/nodeview_space_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,11 @@ def register():

def unregister():
add_node_menu.unregister()
for class_name in classes:
for class_name in reversed(classes):
bpy.utils.unregister_class(class_name)
for category in presets.get_category_names():
for category in reversed(presets.get_category_names()):
if category in preset_category_menus:
bpy.utils.unregister_class(preset_category_menus[category])
# call of unregister not only on close Blender. So it is important to remove this category:
del preset_category_menus[category]
bpy.types.NODE_MT_add.remove(sv_draw_menu)
4 changes: 3 additions & 1 deletion ui/presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,8 @@ def unregister():
for clazz in reversed(classes):
bpy.utils.unregister_class(clazz)

for category, name in preset_add_operators:
for category, name in reversed(preset_add_operators):
bpy.utils.unregister_class(preset_add_operators[(category, name)])

# call of unregister not only on close Blender. So it is important to clear:
preset_add_operators.clear()
2 changes: 1 addition & 1 deletion ui/sv_extra_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,5 @@ def register():


def unregister():
for class_name in classes:
for class_name in reversed(classes):
bpy.utils.unregister_class(class_name)
2 changes: 1 addition & 1 deletion ui/sv_panel_display_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def register():
def unregister():
del bpy.types.NodeTree.displayNodesProps

for cls in classes:
for cls in reversed(classes):
bpy.utils.unregister_class(cls)


Expand Down
2 changes: 1 addition & 1 deletion ui/text_editor_submenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ def register():

def unregister():
bpy.types.TEXT_MT_templates.remove(menu_draw)
for cls in classes:
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
4 changes: 2 additions & 2 deletions utils/sv_update_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,6 @@ def register():
bpy.utils.register_class(SvPrintCommits)

def unregister():
bpy.utils.unregister_class(SverchokCheckForUpgradesSHA)
bpy.utils.unregister_class(SverchokUpdateAddon)
bpy.utils.unregister_class(SvPrintCommits)
bpy.utils.unregister_class(SverchokUpdateAddon)
bpy.utils.unregister_class(SverchokCheckForUpgradesSHA)

0 comments on commit 44e611d

Please sign in to comment.