[Bf-blender-cvs] [4fb02d7f8e9] master: Fix T102482: Crash loading geometry nodes assets after file load

Julian Eisel noreply at git.blender.org
Tue Nov 15 16:21:22 CET 2022


Commit: 4fb02d7f8e90e195f9b559035639d983d688c2d7
Author: Julian Eisel
Date:   Tue Nov 15 16:15:57 2022 +0100
Branches: master
https://developer.blender.org/rB4fb02d7f8e90e195f9b559035639d983d688c2d7

Fix T102482: Crash loading geometry nodes assets after file load

Asset library data is destructed on file load. Asset lists (weak and
hopefully temporary design) contain pointers into it that would dangle
then. Make sure the asset lists are destructed before the asset library
data.

===================================================================

M	source/blender/windowmanager/intern/wm_files.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index bdac91e990c..cfeaedaa2b1 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -606,6 +606,12 @@ void wm_file_read_report(bContext *C, Main *bmain)
 static void wm_file_read_pre(bContext *C, bool use_data, bool UNUSED(use_userdef))
 {
   if (use_data) {
+    /* XXX Do before executing the callbacks below, otherwise the asset list refers to storage in
+     * the asset library that's destructed through a callback below.
+     * Asset list is weak design and mixes asset representation lifetime management with UI
+     * lifetime. The asset system needs a better defined ownership model. */
+    ED_assetlist_storage_exit();
+
     BKE_callback_exec_null(CTX_data_main(C), BKE_CB_EVT_LOAD_PRE);
     BLI_timer_on_file_load();
   }



More information about the Bf-blender-cvs mailing list