Fix crash caused by bl_keymap_validate clearing key-maps

The fix for disabling add-ons #113206 caused a crash when the
bl_keymap_validate test exited.

This happened because add-on unregister would try to remove key-map
items that had been freed.

Resolve by disabling all addons instead of clearing the keymaps.
This commit is contained in:
Campbell Barton 2023-10-04 22:20:38 +11:00
parent c820f9b85c
commit 93aa1654be
1 changed files with 2 additions and 4 deletions

View File

@ -273,10 +273,8 @@ def main() -> None:
relaxed = "--relaxed" in argv
# NOTE(@ideasman42): Disable add-on items as they may cause differences in the key-map.
# An alternative would be to disable all add-ons, but this is simpler.
if kc_addon := bpy.context.window_manager.keyconfigs.addon:
kc_addon.keymaps.clear()
del kc_addon
import addon_utils
addon_utils.disable_all()
has_error = False