diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-18 17:14:22 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-18 17:15:46 +0300 |
commit | 8f0dc3cef6c3f3e02a0a4322cd241cf379e52552 (patch) | |
tree | 056bef0d4610164ca898b02fb3212ac8ef13613a /release/scripts/modules | |
parent | 3fb11061bad7c76ea53925ed599ee155b0d4222f (diff) |
Fix T50052: bpy.utils.unregister_module doesn't unregister classes of submodules in reload scenario.
reload case would clear TypeMap before unregistering addons, which made
all calls to unregister_module() to do absolutely nothing.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy/utils/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index 66974dedc24..31dd836e034 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -154,8 +154,6 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): original_modules = _sys.modules.values() if reload_scripts: - _bpy_types.TypeMap.clear() - # just unload, don't change user defaults, this means we can sync # to reload. note that they will only actually reload of the # modification time changes. This `won't` work for packages so... @@ -163,6 +161,9 @@ def load_scripts(reload_scripts=False, refresh_scripts=False): for module_name in [ext.module for ext in _user_preferences.addons]: _addon_utils.disable(module_name) + # *AFTER* unregistering all add-ons, otherwise all calls to unregister_module() will silently fail (do nothing). + _bpy_types.TypeMap.clear() + def register_module_call(mod): register = getattr(mod, "register", None) if register: |