diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-06 14:52:35 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-07-06 14:52:35 +0300 |
commit | 81a93df6d22c2f148667b9a6e8308e083a4cec39 (patch) | |
tree | 99a19eaefd44ab2f8ada2faaadcbb6f2e418359b | |
parent | ccef83b2fb7aeb0653bcc13cfc49dac421ac88c8 (diff) |
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.
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |