Fix use-after-free error when exiting on WIN32

The logging API was freed before calling wm_autosave_delete that called
BKE_appdir_folder_id_create to get the auto-save location (when the
temporary directory wasn't found). Detecting BLENDER_USER_AUTOSAVE would
log details about the path, which would read data freed by CLG_exit.
Resolve by calling CLG_exit last.
This commit is contained in:
Campbell Barton
2022-09-09 22:38:55 +10:00
parent f4e5a86544
commit 8f8ae06b51

View File

@@ -634,13 +634,15 @@ void WM_exit_ex(bContext *C, const bool do_python)
BKE_sound_exit();
BKE_appdir_exit();
CLG_exit();
BKE_blender_atexit();
wm_autosave_delete();
BKE_tempdir_session_purge();
/* Keep last (or near last) so logging can be used right up until everything is shut-down. */
CLG_exit();
}
void WM_exit(bContext *C)