From 634410530106e8d37307ac47c564ba4f37f3a0dc Mon Sep 17 00:00:00 2001 From: Ryan Inch Date: Thu, 14 Sep 2023 00:41:55 -0400 Subject: [PATCH] Improve the file loading guard on the undo stack handler. Use a more flexible approach so that the guard will be certain to remain in place until the blend file has loaded to a usable state. This fixes a crash on Windows 11 (GitHub issue 239). --- addons/io_hubs_addon/components/handlers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/io_hubs_addon/components/handlers.py b/addons/io_hubs_addon/components/handlers.py index e7e0fdfb..9c476454 100644 --- a/addons/io_hubs_addon/components/handlers.py +++ b/addons/io_hubs_addon/components/handlers.py @@ -239,11 +239,11 @@ def undo_stack_handler(dummy, depsgraph): global object_data_switched # Return if Blender isn't in a fully loaded state. (Prevents Blender crashing) - if file_loading and not bpy.context.space_data: - file_loading = False - return + if file_loading: + if not bpy.context.space_data: + return - file_loading = False + file_loading = False # Get a representation of the undo stack. binary_stream = io.BytesIO()