[Bf-blender-cvs] [81a93df6d22] blender2.8: Fix crash when startup file has an image in it

Sybren A. Stüvel noreply at git.blender.org
Fri Jul 6 13:53:05 CEST 2018


Commit: 81a93df6d22c2f148667b9a6e8308e083a4cec39
Author: Sybren A. Stüvel
Date:   Fri Jul 6 13:52:35 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB81a93df6d22c2f148667b9a6e8308e083a4cec39

Fix crash when startup file has an image in it

This fixes an issue introduced in d192d723123add1dde3e9f7e9458aefcafb7e7d2.
When starting up, the UI hasn't been fully initialised yet, and calling
wm_event_do_depsgraph() can trigger icon updates when the startup file
contains an image, causing a segfault due to a not-yet-initialised ghash
for the icons.

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

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 240f1e48e4b..6b727a57370 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -484,7 +484,13 @@ static void wm_file_read_post(bContext *C, const bool is_startup_file, const boo
 
 	Main *bmain = CTX_data_main(C);
 	DEG_on_visible_update(bmain, true);
-	wm_event_do_depsgraph(C);
+
+	if (!is_startup_file) {
+		/* When starting up, the UI hasn't been fully initialised yet, and
+		 * this call can trigger icon updates, causing a segfault due to a
+		 * not-yet-initialised ghash for the icons. */
+		wm_event_do_depsgraph(C);
+	}
 
 	ED_editors_init(C);



More information about the Bf-blender-cvs mailing list