diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-28 06:38:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-28 06:38:08 +0300 |
commit | 87d3f4aff3225104cbb8be41ac0339c6a1cd9a85 (patch) | |
tree | 2e4e4f83b7653465ec39a9135c8f932337298a85 /source/blender/python/intern | |
parent | 198980693ba7b183f7d2a32a21b65338edfdeb10 (diff) |
Fix T82675: Crash on exit when Blender is built as a Python module
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index c54c78ae389..64e992bd76f 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -442,6 +442,13 @@ void BPY_python_start(bContext *C, int argc, const char **argv) py_tstate = PyGILState_GetThisThreadState(); PyEval_ReleaseThread(py_tstate); #endif + +#ifdef WITH_PYTHON_MODULE + /* Disable all add-ons at exit, not essential, it just avoids resource leaks, see T71362. */ + BPY_run_string_eval(C, + (const char *[]){"atexit", "addon_utils", NULL}, + "atexit.register(addon_utils.disable_all)"); +#endif } void BPY_python_end(void) |